query_loki_logs
Query container and syslog logs via Loki LogQL with flexible time range and result limits to diagnose issues.
Instructions
Search container/syslog logs via Loki LogQL.
query: LogQL query string, e.g. '{container="grafana"}' or '{container=~".+"} |= "ERROR"' since: how far back, e.g. '1h', '30m', '7d' (Loki duration syntax) limit: max log lines to return (Loki default = 100, hard-capped here at 1000)
Returns a dict with: total_streams, total_lines, streams (list of {labels, lines}). Lines are timestamp-sorted oldest-first. Returns {"error": "..."} on Loki unreachable or invalid query.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes | ||
| since | No | 1h |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||