| name | log-analyzer |
| description | Parse application logs and find root causes. Use when the user shares logs, stack traces, or asks what is causing errors. |
Log Analyzer
Parse, analyze, and extract insights from application logs and error traces.
Description
This skill analyzes application logs, error traces, and system output to identify patterns, root causes, and anomalies. It processes log files in any common format and produces actionable insights for debugging and quality analysis.
Instructions
When the user provides log files, error outputs, or stack traces:
- Parse Logs: Identify the log format and extract structured fields (timestamp, level, message, source)
- Classify Entries: Categorize by severity (ERROR, WARN, INFO, DEBUG)
- Pattern Detection: Find recurring errors, frequency patterns, and correlations
- Root Cause Analysis: Trace error chains and identify likely root causes
- Generate Report: Summarize findings with actionable recommendations
Analysis Capabilities
Error Analysis
- Group similar errors by message pattern
- Identify error frequency and trends
- Trace error propagation chains
- Detect new vs. recurring errors
Pattern Detection
- Time-based patterns (errors spike at specific hours)
- Correlation between different error types
- Request patterns preceding failures
- Memory/resource patterns before crashes
Performance Analysis
- Response time extraction from request logs
- Slow query identification from database logs
- Timeout and connection error patterns
- Resource exhaustion indicators
Stack Trace Analysis
- Extract key frames from stack traces
- Identify the originating code location
- Group stack traces by root cause
- Map exceptions to code modules
Supported Log Formats
- Standard:
[timestamp] [level] [source] message
- JSON: Structured JSON log entries (one per line)
- Apache/Nginx: Common and combined log formats
- Syslog: Standard syslog format
- Custom: Auto-detect delimiter and field patterns
- Stack traces: Java, Python, JavaScript, C#, Go
Output Format
# Log Analysis Report
**File**: [filename]
**Period**: [start] to [end]
**Total Entries**: [count]
## Summary
| Level | Count | Percentage |
|-------|-------|------------|
| ERROR | X | X% |
| WARN | X | X% |
| INFO | X | X% |
## Top Errors (by frequency)
| # | Error Pattern | Count | First Seen | Last Seen |
|---|--------------|-------|------------|-----------|
| 1 | [pattern] | X | [time] | [time] |
## Root Cause Analysis
### Issue 1: [Title]
- **Error**: [error message pattern]
- **Frequency**: X occurrences in Y period
- **Likely Cause**: [analysis]
- **Recommended Action**: [fix suggestion]
- **Related Log Entries**: [line numbers or timestamps]
## Timeline
[Chronological narrative of significant events]
## Recommendations
1. [Prioritized action items]
Example Usage
Analyze this application log file and tell me what's causing the 500 errors:
[paste log content]
Here's a stack trace from our production crash. What's the root cause?
[paste stack trace]