loki_query_range
Run LogQL range queries to retrieve logs or metrics from Loki over a specified time period, outputting compact timestamped results.
Instructions
Run a LogQL range query against Loki.
query: LogQL expression, e.g. {container="nginx"} |= "ERROR"
or a metric query like rate({container="traefik"}[5m]).
start: Duration back from now (15m, 2h, 3d), RFC3339 timestamp,
or ns-since-epoch. Default 1h.
end: Same format as start. Default now.
limit: Max log lines to return (clamped to server max, default 100).
direction: backward (newest first) or forward. Default backward.
Returns compact timestamp [labels] message lines, newest first. For
metric queries returns {labels} ts:val ts:val ... per series.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | now | |
| limit | No | ||
| query | Yes | ||
| start | No | 1h | |
| direction | No | backward |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |