queryLogs
queryLogsRead a bounded, chronological page of Grafana Loki log lines matching a LogQL query in a time window. Supports newest or oldest order, raw previews, and pagination via footer values.
Instructions
Read a bounded page of log lines matching a LogQL query in a window. The response is chronological, with a compact level, service and message view. Example: {app="backend"} |= "ERROR". Use raw=true to preview the line returned by Loki with its stream labels; long lines are shortened. Use order="oldest" to read forward, repeat with the start or end value in the footer, and use exportLogs for complete files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Window end, default now. Use the end in a queryLogs footer to read older lines. | |
| raw | No | Preview the line returned by Loki with stream labels, default false | |
| limit | No | Maximum lines to show, default 50 | |
| order | No | newest (default) or oldest; oldest reads forward | |
| query | Yes | LogQL log query, e.g. {app="backend"} |= "ERROR". Take label names and values from discoverLogs. | |
| start | No | Window start, default now-1h. Examples: now-15m, now-2d, 2026-09-13T10:00:00+03:00. | |
| connection | Yes | Connection name from listConnections |