
Logql Generator
This is a structured workflow for building LogQL queries without memorizing Grafana Loki's syntax. It walks you through stream selectors, parsers, filters, and metric aggregations in stages, asking about your log format, labels, and whether you need raw logs or dashboard metrics. The deterministic flow handles version compatibility intelligently, defaulting to safe syntax when your Loki version is unknown and offering 3.x optimized variants separately. For complex queries like nested aggregations or alerting rules, it enforces a reference checkpoint to pull from local examples before generating output. You can get a final query immediately or step through incremental builds for debugging. Useful when you know what you want to find in logs but not how to express it in LogQL's query pipeline.
- skills.sh installs
- 640
- GitHub stars
- 337
- last updated
- Aug 21, 2026
Install
$ npx -y skills add akin-ozer/cc-devops-skills --skill logql-generator --agent claude-codeInstalls into .claude/skills of the current project.
Files
LogQL Query Generator
Overview
Interactive workflow for generating production-ready LogQL queries. LogQL is Grafana Loki's query language with indexed label selection, line filtering, parsing, and metric aggregation.
Trigger Hints
- "Write a LogQL query for error rate by service."
- "Help me build a Loki alert query."
- "Convert this troubleshooting requirement into LogQL."
- "I need step-by-step LogQL query construction."
Use this skill for query generation, dashboard queries, alerting expressions, and troubleshooting with Loki logs.
Execution Flow (Deterministic)
Always run stages in order. Do not skip required stages.
Stage 1 (Required): Capture Intent
Use AskUserQuestion to collect goal and use case.
Template:
- "What is your primary goal: debugging, alerting, dashboard metric, or investigation?"
- "Do you need a log query (raw lines) or a metric query (numeric output)?"
- "What time window should this cover (example: last 15m, 1h, 24h)?"
Fallback if AskUserQuestion is unavailable:
- Ask the same questions in plain text and continue.
Stage 2 (Required): Capture Log Source Details
Sponsors
Details
- Repository
- github.com/akin-ozer/cc-devops-skills
- Categories
- DevOps & CI/CD, Automation & Workflows
- First seen
- Jun 3, 2026
More from akin-ozer/cc-devops-skills
All 31- Fluentbit Validator637
- Loki Config Generator622
- Ansible Validator1.6K
- Terragrunt Generator1.2K
- Ansible Generator907
- K8s Debug887
- Jenkinsfile Generator862
- Dockerfile Validator786
- Dockerfile Generator741
- Bash Script Validator734
- Gitlab Ci Validator725
- K8s Yaml Validator715
- Helm Validator712
- Bash Script Generator710
- Jenkinsfile Validator706
- Terragrunt Validator703
- K8s Yaml Generator694
- Azure Pipelines Generator692
- Github Actions Validator686
- Gitlab Ci Generator686
- Github Actions Generator684
- Terraform Validator681
- Azure Pipelines Validator680
- Terraform Generator680