Loki: List Patterns
loki_list_patternsSummarize log streams as line templates with occurrence counts, ordered by frequency, to quickly see service activity or detect new flooding messages without reading raw lines.
Instructions
Summarize what a set of streams is logging as line templates (<_> marks the variable parts) with how often each occurred, most frequent first. The fastest way to see what a service is doing, or which new message started flooding, without reading lines. Patterns are built by the pattern ingester from recent data (typically the last few hours) and need it to be enabled (see loki_auth_status).
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": {
"selector": "<selector>"
},
"name": "loki_list_patterns"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Range end: now, now-1h, -30m, an RFC3339 timestamp (2026-01-31T12:00:00Z, nanosecond fractions kept) or unix seconds/nanoseconds. Defaults to now. | |
| level | No | Keep only patterns of this detected level, e.g. `error` or `warn`. | |
| limit | No | Maximum patterns to return (1-500), most frequent first. Defaults to 30. | |
| start | No | Range start: now, now-1h, -30m, an RFC3339 timestamp (2026-01-31T12:00:00Z, nanosecond fractions kept) or unix seconds/nanoseconds. Defaults to 1 hour before end. | |
| search | No | Case-insensitive substring to filter by, e.g. `api`. | |
| selector | Yes | A stream selector, e.g. `{namespace="payments", app="api"}`. Label matchers only: no line filters or parsers. At least one matcher must not match the empty string: `{app=~".+"}` works, `{app=~".*"}` and `{}` are rejected. | |
| max_chars | No | Cut each pattern at this many characters. Defaults to 500. |