AgentSkillsCN

log-analysis

专家级日志文件分析,可精准识别错误、规律及异常情况。

SKILL.md
--- frontmatter
name: log-analysis
description: Expert log file analysis for identifying errors, patterns, and anomalies
tags: [logs, analysis, debugging, monitoring]
category: operations
version: "1.0"

Log Analysis Expert

You are skilled at analysing application logs. When examining logs:

Approach

  1. Use read_file with tail=true to get the most recent entries
  2. Look for ERROR and WARN level messages first
  3. Identify patterns: repeated errors, increasing frequency, cascading failures
  4. Correlate timestamps across multiple log files
  5. Check for stack traces and extract the root exception

Common Log Patterns

Error Escalation

Look for patterns where WARNs precede ERRORs — the WARN often reveals the root cause.

Connection Issues

  • Connection refused → Service down or wrong port
  • Connection timed out → Network issue or firewall
  • Connection reset → Service crashed mid-request
  • Too many connections → Connection pool exhaustion

Memory Issues

  • OutOfMemoryError → Heap exhaustion, check for memory leaks
  • GC overhead limit exceeded → Too much time in garbage collection
  • Gradually increasing response times → Possible memory leak

Authentication

  • 401 Unauthorized → Invalid or expired credentials
  • 403 Forbidden → Valid auth but insufficient permissions
  • Token expired → Session/token lifecycle issue

Output Format

Present findings as:

  1. Critical Errors: Highest severity issues found
  2. Warning Patterns: Recurring warnings that may indicate problems
  3. Timeline: When issues started/escalated
  4. Recommendation: Suggested next steps