log_severity_summary
Count log events grouped by severity over a time window. One tool, three backends — pass stream to pick which.
stream='syslog' → wraps /api/syslog/sevSum (severity 0-7, syslog scheme) stream='eventlog' → wraps /api/eventlog/sevSum (severity 0-5, Windows scheme) stream='eve' → wraps /api/eve/sevSum (severity 1-3, Suricata scheme)
Use this for triage before pulling rows: 'how many criticals on host X today' returns one tight rollup instead of 1000 sample rows. Every result includes both the numeric key and a label so the LLM doesn't have to memorize three different scales.
Window: hours (1-168, default 24) OR start_time+end_time (ISO-8601 UTC). Optional device_id narrows to one device — for eve, the controller translates this to a src_ip OR dst_ip match automatically (eve_log has no device_id column).
ALL-ZERO IS NOT THE SAME AS CLEAN. A dead feed and a quiet network produce byte-identical answers here, so every response carries meta.stream_health:
active — events landed inside your window; the counts mean what they say.
stale — your window is empty, but the stream produced up to last_event_at, before it. The feed is alive and the empty window is real.
silent — nothing in your window AND nothing in the 168h before it. Never report 'clean' from this state; note names the producer to check first.
unknown — freshness could not be established. The zeros prove nothing.
stale/silent come from re-asking the same stream over a window that strictly contains yours (one extra call, and only when every bucket is zero). No staleness threshold is guessed: stale means exactly 'the newest event predates the window you asked for', which on a 1-hour window is unremarkable. checked_back_hours and events_before_window say how much history the verdict rests on.
Permission: logs. Tag-scoped server-side.
Example: log_severity_summary({stream: 'syslog', hours: 1, device_id: 42})
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hours | No | Lookback hours (1-168). Default 24. | |
| stream | Yes | Which log stream to summarize: 'syslog', 'eventlog', or 'eve'. | |
| end_time | No | ISO-8601 UTC; pairs with start_time. | |
| device_id | No | Restrict to a single device id (for eve, translated to src_ip/dst_ip server-side). | |
| start_time | No | ISO-8601 UTC; pairs with end_time. |