Getting started
Navigate to Events > Query in the Orb dashboard. The explorer opens with a default query that counts events by name:Writing queries
Queries follow standard SQL syntax against theevents table. Every event you’ve ingested is available as a row in this table, with the following columns:
| Column | Type | Description |
|---|---|---|
event_name | string | The name of the event (e.g. transaction_processed). |
timestamp_millis | datetime | When the event occurred, in epoch milliseconds. |
idempotency_key | string | The unique identifier for the event. |
customer_id | string | The Orb customer ID the event is attributed to. |
properties | object | The full properties dictionary sent with the event. |
properties is available as a column. If you ingested events with a region property, you can reference region directly in your query without extracting it from the properties object.
SELECT *
You can useSELECT * to return all default columns. This is a convenient starting point when you want to inspect raw events:
event_name, timestamp_millis, idempotency_key, customer_id, and properties.
Filtering with WHERE
UseWHERE clauses to filter to the events you care about. You can combine conditions with AND and OR:
Aggregations
The explorer supports the following aggregation functions:| Function | Description |
|---|---|
COUNT(...) | Count of rows. |
SUM(...) | Sum of values. |
AVG(...) | Average of values. |
MIN(...) | Minimum value. |
MAX(...) | Maximum value. |
EARLIEST_BY(value, order) | Returns the first value, ordered by order. |
LATEST_BY(value, order) | Returns the last value, ordered by order. |
SELECT must appear in a GROUP BY clause:
Scalar functions
You can use the following functions within expressions:| Function | Description |
|---|---|
COALESCE(...) | Returns the first non-null argument. |
LEAST(...) | Returns the minimum of its arguments. |
GREATEST(...) | Returns the maximum of its arguments. |
CEIL(...) | Rounds up to the nearest integer. |
FLOOR(...) | Rounds down to the nearest integer. |
ROUND(...) | Rounds a number to a specified number of decimal places. |
CONCAT(...) | Concatenates strings. |
HOUR_FLOOR_TIMESTAMP_MILLIS(...) | Floors a timestamp (in milliseconds) to the start of the hour. |
Operators
Standard comparison and logical operators are supported:- Arithmetic:
+,-,*,/ - Comparison:
=,!=,>,<,>=,<= - Pattern matching:
LIKE,NOT LIKE - Logical:
AND,OR,IS,IS NOT - Conditionals:
CASE WHEN ... THEN ... ELSE ... END
DISTINCT
UseSELECT DISTINCT to return unique rows:
LIMIT
You can specify aLIMIT to return fewer rows:
LIMIT you specify.
Subqueries
You can use subqueries in theFROM clause for multi-step aggregations:
Query controls
Time range
Every query is scoped to a time range. Select from preset ranges (Last 1 hour, Last 1 day, Last 7 days, Last 30 days) or specify a custom start and end date. The maximum time range is 90 days. The time range is applied as an automatic filter ontimestamp_millis. You do not need to include it in your WHERE clause.
Customer filter
Optionally scope your query to a specific customer. When selected, only events attributed to that customer are included in results. This is useful for debugging a specific customer’s usage or validating that events are being attributed correctly.Honor amendments
When you’ve amended events for a customer (e.g. deprecated incorrect events or backfilled corrected ones), the Honor amendments toggle controls whether the query reflects those changes. When enabled:- Deprecated events are excluded from results.
- Backfilled events are included.
Builder mode
If you prefer a visual interface, switch to Builder mode using the toggle at the top of the editor. The builder lets you construct queries without writing SQL:- Columns: Choose which columns to include in results.
- Filters: Add conditions with a column, operator, and value.
- Aggregation: Select an aggregation function (COUNT, SUM, AVG, MIN, MAX) and the column to aggregate.
- Group by: Choose columns to group results by.
- Time bucket: Bucket results by minute, hour, or day to spot trends.
- Limit: Set the maximum number of rows.
Results
Query results are displayed in a table below the editor. The status bar shows:- Row count: How many rows were returned.
- Query time: How long the query took to execute.
- Truncated indicator: Whether results were capped at the limit.
Datetime display
Thetimestamp_millis column and other datetime values are displayed as human-readable timestamps by default. Toggle the raw display mode to see the original epoch millisecond values.
CSV export
Click the Download CSV button to export the current results. The CSV includes column headers and properly escapes values containing commas, quotes, or newlines.Examples
Count events by name over the last 7 daysLimits
- Results are capped at 1,000 rows per query.
- Time range cannot exceed 90 days.
ORDER BYis not supported. Use aggregations andGROUP BYto organize results.JOIN,WITH(CTEs), andLATERALare not supported. Queries can only access theeventstable.WHEREclauses cannot contain aggregation functions. Use subqueries for post-aggregation filtering.