| name | loki-query |
| description | Check logs with LogQL (Loki/Grafana) — stream selector, filters, redacted samples, rate, investigation report. Evidence-only. |
| user-invocable | true |
| argument-hint | <service or symptom> [--env prod] [--since 1h] [--level ERROR] [@paste] |
/loki-query — Log Check (Loki)
Examples
/loki-query booking-api --env prod --since 1h
/loki-query "timeout" --service booking-api --since 30m
Process
- Scope labels + window
- LogQL plan (
@references/logql-cheat.md)
- Analyze paste only — patterns, ≤10 redacted samples, optional rate query
- Hypotheses + next (
/grafana-explore, elk-kit /log-check, incident process)
- Optional L1 →
docs/ops/grafana/log-checks/LOKI-{date}-{slug}.md
Output
@_templates/loki-log-check.md
Rules
- @.claude/rules/grafana-conventions.md
- @.claude/rules/approval-gate.md