Aggregate (aggregate)
Aggregate events by key and emit summary statistics.
Transform json
Minimal example
JSON
Contents
Fields
| Field | Type | Required | Description |
|---|
description General | string | | describe this step. |
condition General | string | | Only run this action if the condition is met. |
group-by Grouping | string[] | | Fields used to compute the grouping key (optional). |
aggregations | Aggregations[] | | Aggregations to compute for each group. |
time-field Windowing | field (string) | | Field containing the event timestamp (ISO 8601). Examples: data_field |
window Windowing | Window | | Optional window definition for tumbling windows. |
allowed-lateness Windowing | string | | Allow events to arrive up to this duration late (e.g. ”30s”). |
aggregate-trigger Trigger | Aggregate Trigger | | Trigger policy controlling emission cadence. |
max-groups Resources | number (integer) | | Maximum distinct groups tracked in-memory (new groups beyond this limit are dropped). Examples: 42, 1.2e-10 |
output Output | Output | | Output configuration (per-window record or expand). Allowed values: per-window-record, expand-records |
state State | State | | State configuration (in-memory or spill-to-disk). |
reset-on-document Behaviour | boolean (bool) | | Reset aggregation state on document boundaries. |
General
Show fields
| Field | Type | Required | Description |
|---|
description | string | | describe this step. |
condition | string | | Only run this action if the condition is met. |
Grouping
Show fields
| Field | Type | Required | Description |
|---|
group-by | string[] | | Fields used to compute the grouping key (optional). |
Windowing
Show fields
| Field | Type | Required | Description |
|---|
time-field | field (string) | | Field containing the event timestamp (ISO 8601). Examples: data_field |
window | Window | | Optional window definition for tumbling windows. |
allowed-lateness | string | | Allow events to arrive up to this duration late (e.g. ”30s”). |
Trigger
Show fields
| Field | Type | Required | Description |
|---|
aggregate-trigger | Aggregate Trigger | | Trigger policy controlling emission cadence. |
Resources
Show fields
| Field | Type | Required | Description |
|---|
max-groups | number (integer) | | Maximum distinct groups tracked in-memory (new groups beyond this limit are dropped). Examples: 42, 1.2e-10 |
Output
Show fields
| Field | Type | Required | Description |
|---|
output | Output | | Output configuration (per-window record or expand). Allowed values: per-window-record, expand-records |
State
Show fields
| Field | Type | Required | Description |
|---|
state | State | | State configuration (in-memory or spill-to-disk). |
Behaviour
Show fields
| Field | Type | Required | Description |
|---|
reset-on-document | boolean (bool) | | Reset aggregation state on document boundaries. |
Schema
State Options
| Option | Name | Type | Description |
|---|
in-memory | In Memory | map | |
spill-to-disk | Spill To Disk | object | Persist state to disk under the job data directory configured for the runtime. |
Aggregations Fields
| Field | Type | Required | Description |
|---|
field | string | ✅ | Source field for aggregation. |
op | Op | | Aggregation operation. Allowed values: count, sum, mean, min, max, first, last, stddev, … |
r-as | string | | Alias for the output field (defaults to op_field). |
Window Fields
| Field | Type | Required | Description |
|---|
size | string | ✅ | Window size (e.g. “1m”). |
offset | string | | Optional offset applied to the window (e.g. ”10s”). |
Aggregate Trigger Fields
| Field | Type | Required | Description |
|---|
count | number (integer) | | Emit after this many events per group. Examples: 42, 1.2e-10 |
interval | string | | Emit periodically based on processing time (e.g. ”30s”). |
on-window-close | boolean (bool) | | Emit when a window closes. |
State - Spill To Disk Fields
| Field | Type | Required | Description |
|---|
dir | string | ✅ | Subdirectory (or relative path) within the job data directory to store spill files. |
Aggregations - Op Options
| Value | Description |
|---|
count | Count |
sum | Sum |
mean | Mean |
min | Min |
max | Max |
first | First |
last | Last |
stddev | Stddev |
variance | Variance |
z-score | Z Score |
Output Options
| Value | Description |
|---|
per-window-record | Emit a single record summarising the window/group |
expand-records | Expand aggregated results into individual events per source event |