log-error-digest

Analyze log files to cluster errors, compute frequency statistics, and report time distributions.

4.6k|462|Updated Jun 21, 2025
One-click install
npx skills add https://github.com/zebbern/claude-code-guide --skill log-error-digest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: log-error-digest
Source: https://github.com/zebbern/claude-code-guide/tree/main/skills/log-error-digest
Command: npx skills add https://github.com/zebbern/claude-code-guide --skill log-error-digest

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Troubleshooting production issues from raw log files requires manually scanning thousands of lines to find recurring errors and peak failure periods. This Skill automates that analysis by parsing log files, grouping similar errors into clusters, and producing frequency and time-distribution reports.

Core Features & Use Cases

  • Error Clustering: Normalizes dynamic parts of messages (IPs, UUIDs, timestamps, numbers) to group similar errors and identify root causes, with first-seen and last-seen timestamps.
  • Multi-Format Parsing: Supports JSON, syslog (RFC 3164), and Nginx access/error logs with automatic format detection.
  • Time Distribution Reports: Shows error counts by hour and by date with terminal bar charts, plus optional JSON export for integration with monitoring systems.
  • Use Case: After a service outage, run the analyzer on /var/log/nginx/error.log to instantly see the top error patterns, when they started, and which hours had the most failures.

Quick Start

Ask the assistant to analyze the uploaded log file with the log-error-digest skill to show the top error clusters and hourly error distribution.

Frequently Asked Questions about log-error-digest

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

FAQPage Schema
How do I analyze log files to find recurring errors?

Run the analyze_logs.py script with the log file path to automatically cluster similar error messages by normalizing dynamic parts like IPs and UUIDs. The report shows the top error patterns ranked by occurrence count with first and last seen timestamps.

What log formats does log analysis support?

The analyzer supports JSON (one object per line with timestamp/level/message fields), syslog (RFC 3164), and Nginx access and error log formats. Format detection is automatic based on line patterns, or you can force a format with the --format flag.

Can I filter log analysis by time range or log level?

Yes, use the --since and --until parameters with ISO-format timestamps to restrict analysis to a specific time window. The --level parameter filters entries to a single level such as ERROR or WARN.

Does the log analyzer require external Python packages?

No, the script uses only Python standard library modules including argparse, json, re, and collections. It runs on any standard Python 3 installation without installing additional dependencies.

How do I export log analysis results to JSON?

Pass the --output parameter with a file path to write a structured JSON report alongside the terminal output. The JSON includes a summary, error clusters, level distribution, and hourly and daily time distributions for integration with monitoring systems.