nano SIEM
Search Commands

transaction

Group events that share key values into one row per transaction, with duration and event count.

Use transaction to group events that share your chosen key values. Each result row includes the transaction's start, end, duration, and event count.

Syntax

... | transaction <field>[, <field> ...] [startswith=<condition>] [endswith=<condition>] [maxspan=<duration>] [maxevents=<n>]
ArgumentDefaultDescription
fieldrequiredOne or more fields that identify a transaction. Events where a key field is empty are left out.
startswithnoneCondition that opens a transaction. Write it as (expr), "string" or a bare expression.
endswithnoneCondition that closes a transaction.
maxspannoneLongest allowed transaction, for example 30m.
maxeventsnoneMost events allowed in one transaction.

Output fields

FieldDescription
key fieldsThe values that identify the transaction
transaction_start, transaction_endTime of the first and last event
durationSeconds between the first and last event
eventcountNumber of events in the transaction
_raw_eventsThe events' message values (up to 1,000, or up to maxevents)
other fields named in the searchThe value from the transaction's latest event

Rows are ordered by transaction_start, newest first.

How it works

  • Without startswith/endswith, all events for a key value form one transaction. With maxspan, events are cut into fixed windows of that length aligned to the clock (for example maxspan=10m gives 10:00–10:10, 10:10–10:20, …), one transaction per key per window.
  • With startswith, each matching event opens a new transaction for that key. With endswith, the transaction closes at the first matching event, and only transactions that reach an end event are returned.
  • maxspan and maxevents drop transactions that are longer or larger than the limit; they don't split them.

Examples

Logon activity per user in 10-minute windows, busiest first:

class_uid=3002 | transaction user.name maxspan=10m | sort -eventcount | table user.name, transaction_start, eventcount, duration

Failed logons followed by a success for the same user within 15 minutes:

class_uid=3002 | transaction user.name startswith=(status_id=2) endswith=(status_id=1) maxspan=15m | table user.name, transaction_start, duration, eventcount

Short bursts of failures (at least 20 failed logons for one account in 5 minutes):

class_uid=3002 status_id=2 | transaction user.name maxspan=5m | where eventcount >= 20 | table user.name, transaction_start, eventcount

Connection bursts from one host to one destination port:

class_uid=4001 | transaction device.hostname, dst_endpoint.port maxspan=1m | where eventcount > 100 | table device.hostname, dst_endpoint.port, eventcount, duration

Web sessions per client IP, capped at 200 requests:

class_uid=4002 | transaction src_endpoint.ip maxspan=30m maxevents=200 | stats avg(duration) as avg_seconds, avg(eventcount) as avg_requests

Notes

  • transaction returns one row per transaction, not the events. To see events, filter on the key value and the transaction_start/transaction_end range.
  • For ordered multi-step patterns with different conditions per step, sequence is more precise.

What's next

  • sequence: ordered patterns across steps
  • funnel: how far entities progress through steps
  • stats: aggregate without grouping into transactions
  • streamstats: running statistics per event

On this page