Aggregate Session
Description
note
This page describes the behavior specific to aggregations in the session window. For concepts and configuration common to all time-window aggregations, see Aggregations in time windows.
A session window groups events that belong to one continuous period of activity. Unlike sliding and tumbling windows, a session window does not have a fixed length.
A separate session is maintained for each groupBy value.
A session closes when either:
endSessionConditionevaluates totrue, or- the time since the last event for that
groupByvalue exceedssessionTimeout.

For simplicity, all events share the same groupBy value ("purple")
The computed aggregations can be emitted:
On each event- enrich the incoming event with the current aggregate. No additional aggregate event is emitted when the session ends.After session end- incoming events do not continue downstream; when the session closes, a new aggregate event is emitted. Variables belonging to the original events, such as #input and #inputMeta, are therefore unavailable downstream.
Parameters and configuration
Parameters common to all windows are described here.
| Parameter | Description |
|---|---|
endSessionCondition | Expression evaluated for incoming events. When it evaluates to true, the current session closes. Set it to false if sessions should close only because of inactivity. |
sessionTimeout | Amount of inactivity after which a session closes. The inactivity period is measured separately for each groupBy value. |
emitWhen | Determines whether incoming events are enriched while the session is active or a new aggregate event is emitted after the session closes. |