Skip to main content
The reduce transform groups similar events and flushes them as a single event with a count. When an error storm sends 10,000 identical messages in a minute, reduce collapses them into one event with _reduced_count: 10000 — cutting storage costs without losing information.

Quick start

This groups events by error_code and flushes each group after 5 seconds.

How it works

  1. Events are grouped by the fields you specify in group_by
  2. When a group reaches max_events or the time window expires, it flushes
  3. The first event in each group is emitted with metadata fields added:
    • _reduced_count — how many events were consolidated
    • _reduced_span_ms — time span from first to last event in the group
Groups with fewer than min_events pass through unchanged — no metadata is added.

Grouping

The group_by field controls what counts as “similar.” Events with the same values for these fields land in the same group.
If group_by is empty, events are grouped by their entire content — only exact duplicates are consolidated.

Examples

Collapse error storms:
Only groups with 5+ events are reduced. Smaller groups pass through unchanged. Deduplicate health checks:
Aggressive cost reduction:

Reference