log-analysis
Installation
SKILL.md
log-analysis Skill
Goal
This skill helps agents and engineers interpret logging data to find root causes of issues.
Steps
1. Structured Logging (The Prerequisite)
- Format: JSON. Always.
- Why: Allows querying
level="ERROR" AND service="user-api". Text logs require fragile regex. - Context: Every log must have
trace_id,user_id, andenvironment.
2. Analysis Workflow
- Scope the Timeframe: "Last 15 minutes" or "Since deployment at 14:00".
- Filter by Level: Start with
ERRORandFATAL. IgnoreINFOinitially. - Group by Message:
- Bad: Reading 1000 lines of
Connection timeout. - Good: "Count of errors by message type: Timeout (800), Auth Fail (200)".
- Bad: Reading 1000 lines of
- Trace Correlation: take one
trace_idfrom an error and filter ALL logs (inc INFO) for that ID to see the sequence of events leading to failure.