loki-logql-query-specialist

Query Loki logs with LogQL for cross-service correlation tracing.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/paunchygent/docforge --skill loki-logql-query-specialist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: loki-logql-query-specialist
Source: https://github.com/paunchygent/docforge/tree/main/frontend/.claude/skills/loki-logql
Command: npx skills add https://github.com/paunchygent/docforge --skill loki-logql-query-specialist

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you query Loki logs using LogQL with patterns optimized for correlation tracing, error investigation, and service debugging. It provides practical templates and guidance for extracting correlation IDs, filtering by service, and parsing JSON fields, reducing time spent hunting through logs.

Core Features & Use Cases

  • Correlation ID Tracing: Find logs across services that share the same correlation ID.
  • Error Investigation: Pattern-based queries to surface errors with context.
  • Service-Specific Queries: Filter by container or service to narrow results.
  • Promtail Labeling Guidance: Learn how labels affect query performance and organization.
  • Grafana & Loki Integration: Use queries in Grafana panels or Loki API.

Quick Start

Run a Loki query in Grafana or Loki API using a sample correlation_id value. Example: {container=~"huleedu_.*"} |= "correlation_id_value" and refine the container or service labels as needed to isolate results across the stack.

Frequently Asked Questions about loki-logql-query-specialist

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

FAQPage Schema
How do I trace logs across services using a correlation ID in Loki?

Correlation ID tracing in Loki lets you find all logs sharing the same ID across your service stack. Use a LogQL query like {container=~"huleedu_.*"} |= "correlation_id_value" to filter by container labels and extract matching logs, then refine service or container labels to isolate results across Grafana dashboards.

What's the best way to query Loki logs for error investigation?

Error investigation with LogQL uses pattern-based queries to surface errors with full context. Filter by service or container label, then use |= or |~ operators to match error keywords or patterns, combining label-based filtering with JSON field extraction to narrow results quickly.

How do I extract JSON fields from Loki logs in LogQL queries?

LogQL supports JSON field extraction through pattern matching and label filters. Structure queries to parse JSON payloads within log lines, allowing you to filter and extract specific fields like correlation IDs or service names from unstructured log data.

Can I use Promtail labels to improve Loki query performance?

Promtail labeling directly affects Loki query performance and organization. Strategic label assignment—such as container, service, or environment tags—reduces query scope and response time, enabling faster filtering and more targeted correlation tracing across your microservice stack.

How do I query service-specific logs in Loki from a microservice architecture?

Service-specific queries in Loki filter by container or service labels to isolate logs from individual microservices. Use label matchers like {container=~"service_name_.*"} combined with additional filters to narrow results to a single service within your HuleEdu stack.