Skip to main content

Description

The Reduce processor takes multiple log input events and combines them into a single log event based on specified criteria.

Use

Reduce will combine many events into one over a window of time. This is useful for retaining event fidelity, but eliminating unnecessary or duplicate fields that do not need to be stored. Reduce can use one or more Group By fields to determine when to perform an operation. For example, you could use a session_Id field value that is consistent across many event messages as criteria for putting those events into a single group to be merged. You may specify more than one Group By field, in which case each message with a unique combination of those field values opens a separate group of events to be merged together. You can configure how fields are handled on a per-field basis with a merge strategy. If you don’t specify the merge strategy, a default merge strategy for each reduced event follows this pattern:
  • String fields - The first value is kept while successive ones are discarded
  • Number fields - The values are summed, and that result becomes the value of the field

Configuration

There are three options to configure for this processor. Note that two of these can have any number of values specified.
The Reduce processor has a maximum window of 2 hrs or 7200000 milliseconds.

Merge Strategy Options

The merge options define how the fields will be combined. Note that certain strategies require numeric values in order to function.

Flush conditions

Flush conditions define the logical parameters to determine the start or stop of the Reducing behavior. Flush conditions work on the event context, so the conditions apply to the latest event received, not to the merged event.

Examples

Reducing a firewall event

Given a typical AWS firewall TCP event, we want to summarize multiple event messages into a single message.
The group by conditions leverage the following fields:
  1. src_ip
  2. src_port
  3. dest_ip
  4. dest_port
The merge strategy:
  • Retains the last timestamp ts, event_dest_port, event_src_port
  • Keeps the unique array of the tcp values
  • All other fields are using the default merge strategies, which sums the bytes and packets and keeps the first values for all other strings
In this case the 2 events will be combined as follows with the default merge: