Aggregate
aggregateCompute exact Graylog counts, time histograms, top field values, or grouped errors to size a problem and find when it started.
Instructions
Exact counts computed by Graylog. kind='count': number of matching messages, cheap, to size a problem. 'histogram': counts over time with the peak, first/last non-empty bucket and the 'onset' of a spike, to find when a problem started. 'top': top values of the group_by field with counts and percentages. 'errors': errors (configured error query) grouped by exception, logger, source or any field, with first/last seen and a sample message per group.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"kind": "<kind>"
},
"name": "aggregate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | What to compute | |
| limit | No | top/errors: number of groups (default 10) | |
| query | No | Lucene query, '*' by default; for 'errors' ANDed with the error query | |
| range | No | Relative range: '15m', '2h', '1d'; 15m for count, else 1h | |
| samples | No | errors: one sample message per group (default true) | |
| streams | No | Stream titles or ids; default the repository's focus, else all. ['*'] for everything | |
| to_time | No | Absolute end; default now | |
| group_by | No | top: the field (required); errors: 'exception' (default), 'logger', 'source' or a field | |
| instance | No | Instance from describe, e.g. 'payment/prod'; the default when omitted | |
| interval | No | histogram: bucket size such as '5m'; automatic | |
| from_time | No | Absolute start, overrides range: ISO 8601 or 'YYYY-MM-DD HH:MM' |