loki-query

Query infrastructure logs from Loki via the HTTP API using Bash, curl, and jq.

1|1|Updated Dec 27, 2023
One-click install
npx skills add https://github.com/bcotton/nix-config --skill loki-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: loki-query
Source: https://github.com/bcotton/nix-config/tree/main/.claude/skills/loki-query
Command: npx skills add https://github.com/bcotton/nix-config --skill loki-query

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill allows you to efficiently search and analyze logs from your infrastructure stored in Loki, enabling quick debugging and issue investigation.

Core Features & Use Cases

  • Log Searching: Find specific log entries based on various labels like hostname, job, and unit.
  • Error Identification: Quickly pinpoint errors, warnings, and critical events across your systems.
  • Pattern Analysis: Identify trends and anomalies in log data over specified time ranges.
  • Use Case: When a service is reported to be down, use this Skill to query logs for that service on the relevant host to identify the root cause of the failure.

Quick Start

Use the loki-query skill to find all error messages on the 'nas-01' host in the last hour.

Frequently Asked Questions about loki-query

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

FAQPage Schema
How do I query infrastructure logs from Loki to debug a service failure?

You can query infrastructure logs from Loki by filtering based on hostname, job, unit, and priority. This allows you to investigate errors, debug services, and analyze log patterns over specified time ranges.

Can I filter Loki logs by hostname and time range to find specific errors?

Yes, filtering Loki logs by hostname, job, unit, and priority with time range selection is supported. This allows you to quickly pinpoint errors, warnings, and critical events across your infrastructure.

What is the best way to analyze log patterns and anomalies stored in Loki?

Analyzing log patterns and anomalies in Loki involves querying logs over specified time ranges to identify trends. You can investigate errors by utilizing filtering options for hostname, job, unit, and priority.

Does querying Loki for troubleshooting require any specific dependencies or environments?

Querying Loki for troubleshooting requires an environment with Bash, curl, and jq installed. These tools interact directly with the Loki HTTP API to fetch and format your infrastructure log data.

How do I identify critical events across my infrastructure using Loki?

You identify critical events in Loki by filtering logs by priority levels. This allows you to quickly pinpoint warnings and errors across your systems to investigate issues and debug services efficiently.