query_loki_logs
Execute LogQL queries against Loki datasources to retrieve log entries and metric values within specified time ranges for monitoring and analysis.
Instructions
Executes a LogQL query against a Loki datasource to retrieve log entries or metric values
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": {
"datasourceUid": "<datasourceUid>",
"logql": "<logql>"
},
"name": "query_loki_logs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| datasourceUid | Yes | The UID of the datasource to query | |
| direction | No | Direction of the query | |
| endRfc3339 | No | The end time of the query in RFC3339 format | |
| limit | No | Maximum number of log lines to return (default: 10, max: 100) | |
| logql | Yes | The LogQL query to execute against Loki | |
| startRfc3339 | No | The start time of the query in RFC3339 format |