Log Analysis

VerifiedSafe

Analyze application and system logs to identify errors, patterns, and root causes. Use log aggregation tools and structured logging for effective debugging. Ideal for troubleshooting errors, performance investigations, and security incident analysis.

Sby Skills Guide Bot
DevOpsIntermediate
3/1/2026
Claude CodeCursorWindsurfCopilotCodex
#logging#log-analysis#observability#debugging#monitoring

Recommended for

Automated summary

Explains how to analyze application and system logs to spot errors, patterns, and root causes using structured logging and log aggregation tools.

Strengths

  • Contrasts structured (JSON) and unstructured logging with side-by-side code examples
  • Maps each log level from DEBUG to FATAL to concrete production guidance
  • Surveys aggregation stacks (ELK, Splunk, CloudWatch, Datadog) with their trade-offs
  • Offers reusable query patterns for time windows, trace IDs, slow requests, and error rates by service

Limitations

  • The closing checklist is cut off mid-item and the document ends abruptly
  • YAML blocks are illustrative pseudo-queries rather than real syntax for any specific tool
  • Stays conceptual: no parsing scripts, dashboard configs, retention policy, or PII redaction guidance
When to use it

During a production incident or a performance/security investigation when you need to search logs or restructure how they are emitted.

When not to use it

When you need tool-specific query syntax, a runnable parsing script, or a ready-to-apply pipeline configuration.

Security analysis

Safe
Quality score66/100

This skill is pure documentation/guidance about log analysis with no executable steps. It declares no tools, contains no shell commands that run (grep/awk appear only as illustrative examples), no network calls, no credential handling, and no destructive actions. It actually promotes good practice by advising against logging secrets such as passwords and tokens, so there is no meaningful execution risk in listing it.

No concerns found

How this analysis is made

Examples

Find root cause in pasted logs
Here are 200 lines of our Node.js application logs. Find the errors, group them by pattern, and tell me the most likely root cause.
Convert to structured logging
Our auth service uses console.log everywhere. Show me how to rewrite these log statements as structured JSON logs with trace_id, user_id, log levels, and duration.
Write error-rate query
Write a log query to pull all ERROR-level events from the api-gateway service over the last hour and compute the error count per service.

name: log-analysis description: Analyze application and system logs to identify errors, patterns, and root causes. Use log aggregation tools and structured logging for effective debugging.

Log Analysis

Overview

Logs are critical for debugging and monitoring. Effective log analysis quickly identifies issues and enables root cause analysis.

When to Use

  • Troubleshooting errors
  • Performance investigation
  • Security incident analysis
  • Auditing user actions
  • Monitoring application health

Instructions

1. Structured Logging

// Good: Structured logs (machine-readable)
logger.info({
  level: 'INFO',
  timestamp: '2024-01-15T10:30:00Z',
  service: 'auth-service',
  user_id: '12345',
  action: 'user_login',
  status: 'success',
  duration_ms: 150,
  ip_address: '192.168.1.1'
});

// Bad: Unstructured logs (hard to parse)
console.log('User 12345 logged in successfully in 150ms from 192.168.1.1');

// JSON Format (Elasticsearch friendly)
{
  "@timestamp": "2024-01-15T10:30:00Z",
  "level": "ERROR",
  "service": "api-gateway",
  "trace_id": "abc123",
  "message": "Database connection failed",
  "error": {
    "type": "ConnectionError",
    "code": "ECONNREFUSED"
  },
  "context": {
    "database": "users",
    "operation": "SELECT"
  }
}

2. Log Levels & Patterns

Log Levels:

DEBUG: Detailed diagnostic info
  - Variable values
  - Function entry/exit
  - Intermediate calculations
  - Use: Development only

INFO: General informational messages
  - Startup/shutdown
  - User actions
  - Configuration changes
  - Use: Production (normal operations)

WARN: Warning messages (potential issues)
  - Deprecated API usage
  - Performance degradation
  - Resource limits approaching
  - Use: Production (investigate soon)

ERROR: Error conditions
  - Failed operations
  - Exceptions
  - Failed requests
  - Use: Production (action required)

FATAL/CRITICAL: System unusable
  - Critical failures
  - Out of memory
  - Data corruption
  - Use: Production (immediate action)

---

Log Patterns:

Request Logging:
  - Request ID (trace_id)
  - Method + Path
  - Status code
  - Duration
  - Request size / response size

Error Logging:
  - Error type/code
  - Error message
  - Stack trace
  - Context (user_id, session_id)
  - Timestamp

Business Events:
  - Event type
  - User involved
  - Impact/importance
  - Timestamp
  - Relevant context

3. Log Analysis Tools

Log Aggregation:

ELK Stack (Elasticsearch, Logstash, Kibana):
  - Logstash: Parse and process logs
  - Elasticsearch: Search and analyze
  - Kibana: Visualization and dashboards
  - Use: Large scale, complex queries

Splunk:
  - Comprehensive log management
  - Real-time search and analysis
  - Dashboards and alerts
  - Use: Enterprise (expensive)

CloudWatch (AWS):
  - Integrated with AWS services
  - Log Insights for querying
  - Dashboards
  - Use: AWS-based systems

Datadog:
  - Application performance monitoring
  - Log management
  - Real-time alerts
  - Use: SaaS monitoring

---
Log Analysis Techniques:

Grep/Awk: grep "ERROR" app.log
  awk '{print $1, $4}' app.log

Filtering: Filter by timestamp
  Filter by service
  Filter by error type
  Filter by user

Searching: Search for error patterns
  Search for user actions
  Search trace IDs
  Search IP addresses

Aggregation: Count occurrences
  Group by error type
  Calculate duration percentiles
  Rate of errors over time

4. Common Log Analysis Queries

Find errors in past hour:
  timestamp: last_1h AND level: ERROR

Track user activity:
  user_id: 12345 AND action: *

Find slow requests:
  duration_ms: >1000 AND level: INFO

Analyze error rate by service:
  level: ERROR | stats count by service

Find failed database operations:
  error.type: "DatabaseError" | stats count

Trace request flow:
  trace_id: "abc123" | sort by timestamp

---

Checklist:

[ ] Structured logging implemented
[ ] All errors logged with context
[ ] Request IDs/trace IDs used
[ ] Sensitive data not logged (passwords, tokens)
[ ] Log levels used appropriately
[ ] Log retention policy set
[ ] Log sampling for high-volume events
[ ] Alerts configured for errors
[ ] Dashboards created
[ ] Regular log review scheduled
[ ] Log analysis tools accessible
[ ] Team trained on querying logs

Key Points

  • Use structured JSON logging
  • Include trace IDs for request tracking
  • Log appropriate levels (DEBUG/INFO/ERROR)
  • Never log sensitive data (passwords, tokens)
  • Aggregate logs centrally
  • Create dashboards for key metrics
  • Alert on error rates and critical issues
  • Retain logs appropriately
  • Search logs by trace ID for troubleshooting
  • Review logs regularly for patterns

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/log-analysis-mm78no4x/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/log-analysis-mm78no4x' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/log-analysis-mm78no4x/download' --output '.skill-downloads/log-analysis-mm78no4x/SKILL.md.part' && mv '.skill-downloads/log-analysis-mm78no4x/SKILL.md.part' '.skill-downloads/log-analysis-mm78no4x/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/log-analysis-mm78no4x/SKILL.md' && test -s '.skill-downloads/log-analysis-mm78no4x/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/log-analysis' && cp -R '.skill-downloads/log-analysis-mm78no4x' '.claude/skills/log-analysis'

Cursor
test -f '.skill-downloads/log-analysis-mm78no4x/SKILL.md' && test -s '.skill-downloads/log-analysis-mm78no4x/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/log-analysis' && cp -R '.skill-downloads/log-analysis-mm78no4x' '.cursor/skills/log-analysis'

Codex
test -f '.skill-downloads/log-analysis-mm78no4x/SKILL.md' && test -s '.skill-downloads/log-analysis-mm78no4x/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/log-analysis' && cp -R '.skill-downloads/log-analysis-mm78no4x' '.agents/skills/log-analysis'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/log-analysis-mm78no4x'

openskills read 'log-analysis-mm78no4x'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/log-analysis-mm78no4x/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills