Aggregate alerts by field
wazuh_alert_statsAggregate Wazuh alerts by specified fields (e.g., rule, agent) to return counts, with filters for time range, severity, agent, and group.
Instructions
Group alerts by one or two fields and return counts — the tool for 'top 10 rules today', 'which agents are noisiest', 'alert counts by MITRE tactic', or 'top source IPs per agent'. Far cheaper than fetching alerts and counting them yourself.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Window end. Defaults to now. | |
| top | No | Number of buckets for the first field. | |
| text | No | Lucene query to narrow the set. | |
| start | No | Window start. Defaults to 24h ago. | |
| then_by | No | Optional second grouping field, nested inside the first. | |
| agent_id | No | ||
| group_by | No | Field to group by. Common choices: rule.description, rule.id, rule.level, rule.groups, agent.name, rule.mitre.technique, rule.mitre.tactic, data.srcip, location, decoder.name. | rule.description |
| severity | No | ||
| min_level | No | ||
| rule_group | No | ||
| top_nested | No | Buckets for the second field. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||