query_loki
Query and analyze Grafana Loki logs using LogQL with specified time ranges, output formats, and result limits. Extract structured log data for troubleshooting and monitoring purposes via the Loki MCP Server.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
batch | No | Batch size for query results | |
forward | No | Display results in chronological order | |
from | No | Start timestamp in UTC (e.g. '2023-01-01T12:00:00Z'). Relative time expressions like '1h ago' are not supported. Use ISO 8601 format. | |
limit | No | Maximum number of logs to return. Maximum value is 1000 | |
output | No | Output format - valid values are 'default' (formatted log lines), 'raw' (unprocessed log lines), or 'jsonl' (JSON Lines format). Note: values like 'text' or 'json' are not supported. | |
query | Yes | Loki query string | |
quiet | No | Suppress query metadata | |
to | No | End timestamp in UTC (e.g. '2023-01-01T13:00:00Z'). Relative time expressions like 'now' are not supported. Use ISO 8601 format. |