Back to Floor
The Data Forge • Room 2

The Stats Command

The `stats` command calculates statistics based on fields in your events. It can count, average, sum, and find distinct values.

You structure it like: `| stats count by field_name` to get the number of events per unique value of that field.

Count errors by host
index=main "error" | stats count by host

Knowledge Check

Prove your understanding to clear the room (Rewards XP)
Complete the search to find the total bandwidth (sum of bytes) grouped by action:
index=web | stats (bytes) action