Agent skill
log-analysis
Parsing structured logs, finding patterns in noise, and ELK/Splunk querying.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/security-andreibesleaga-gabbe-6
SKILL.md
log-analysis Skill
This skill helps agents and engineers interpret logging data to find root causes of issues.
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.
3. Query Cheatsheet
Loki (LogQL)
{app="frontend"} |= "error" | json | latency > 500ms
Elasticsearch / Kibana (Lucene)
service:backend AND level:ERROR AND NOT message:"healthcheck"
Splunk
index=prod sourcetype=k8s | stats count by message | sort - count
Command Line (jq)
cat logs.json | jq 'select(.level=="error") | .message' | sort | uniq -c
4. Red Flags ("Smells")
- "Swallowed Exception": Logs that say "Error occurred" but print no stack trace.
- "Noise": Periodic errors (e.g., every 5 mins) that everyone ignores. These mask real issues.
- "Sensitive Data": Passwords or PII in logs. -> CRITICAL: Report immediately.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?