discoverLogs
discoverLogsList Loki label names and values before writing LogQL. Use a stream selector to inspect label sets, then confirm log lines with counts or queries.
Instructions
Discover labels before writing LogQL. Without label or match, list label names; label="app" lists its values. match="{app=\"api\"}" lists complete stream label sets; add label="namespace" to list namespace values among those sets. Use a narrow match and time window, then countLogs or queryLogs to check log lines.
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": {
"connection": "<connection>"
},
"name": "discoverLogs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Window end, default now. Use the end in a queryLogs footer to read older lines. | |
| label | No | Optional label name, e.g. "app": list its values | |
| match | No | Optional LogQL stream selector, e.g. {app="api"}; no line filters | |
| 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 |