logql-generator

Generate LogQL queries for Grafana Loki with filtering, parsing, and aggregation.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/sudohakan/claude-code-dotfiles --skill logql-generator-sudohakan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logql-generator
Source: https://github.com/sudohakan/claude-code-dotfiles/tree/main/config/skills/cc-devops-skills/devops-skills-plugin/skills/logql-generator
Command: npx skills add https://github.com/sudohakan/claude-code-dotfiles --skill logql-generator-sudohakan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill simplifies the creation of complex and efficient LogQL queries for Grafana Loki, ensuring best practices are followed and reducing troubleshooting time.

Core Features & Use Cases

  • LogQL Query Generation: Interactively builds LogQL queries for filtering, parsing, and aggregation.
  • Best Practice Adherence: Incorporates performance optimizations and safety checks.
  • Use Case: You need to create an alert for high error rates in your application logs. This Skill will guide you through defining the log sources, filters, and aggregation needed to build a precise and performant LogQL alert rule.

Quick Start

Use the logql-generator skill to create a LogQL query that counts errors in the 'production' namespace over the last 5 minutes.

Frequently Asked Questions about logql-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a LogQL query to count errors in a specific namespace?

To generate a LogQL query, you interactively plan the log sources, identify labels, and specify parsing and aggregations. This builds a production-ready query following current Grafana Loki conventions.

How do I create alerting rules for high error rates using Grafana Loki?

Creating alerting rules for high error rates involves defining log sources, applying filters, and configuring aggregations. This builds a precise and performant LogQL alert rule for Grafana Loki.

What is the best way to parse and aggregate logs in Loki?

The best way to parse and aggregate logs is through interactive planning that identifies labels and specifies operations. This ensures performance optimizations and safety checks are incorporated into the LogQL query.

Can I use this approach to build log analysis dashboards for Grafana?

Yes, you can use this approach to implement log analysis dashboards by generating production-ready LogQL queries. It assists in creating the precise filtering and aggregation logic required for dashboard visualizations.

Does generating LogQL queries require specific prerequisites or environments?

Generating LogQL queries requires a Grafana Loki environment to execute the output. No specific dependencies are needed to build the queries, as the process focuses on interactive planning and label identification.

Why should I use an interactive generator instead of writing LogQL manually?

Using an interactive generator ensures best practice adherence and reduces troubleshooting time. It incorporates performance optimizations and safety checks that prevent common errors when writing LogQL manually.