Log Analysis Tool
Analyze application logs to identify slow requests, recurring error patterns, and resource usage anomalies with structured reporting and optimization recommendations.
Overview
This skill empowers Claude to automatically analyze application logs, pinpoint performance bottlenecks, and identify recurring errors. It streamlines the debugging process and helps optimize application performance by extracting key insights from log data.
How It Works
- Initiate Analysis: Claude activates the log analysis tool upon detecting relevant trigger phrases.
- Log Data Extraction: The tool extracts relevant data, including timestamps, request durations, error messages, and resource usage metrics.
- Pattern Identification: The tool identifies patterns such as slow requests, frequent errors, and resource exhaustion warnings.
- Report Generation: Claude presents a summary of findings, highlighting potential performance issues and optimization opportunities.
When to Use This Skill
This skill activates when you need to:
- Identify performance bottlenecks in an application.
- Debug recurring errors and exceptions.
- Analyze log data for trends and anomalies.
- Set up structured logging or log aggregation.
Examples
Example 1: Identifying Slow Requests
User request: "Analyze logs for slow requests."
The skill will:
- Activate the log analysis tool.
- Identify requests exceeding predefined latency thresholds.
- Present a list of slow requests with corresponding timestamps and durations.
Example 2: Detecting Error Patterns
User request: "Find error patterns in the application logs."
The skill will:
- Activate the log analysis tool.
- Scan logs for recurring error messages and exceptions.
- Group similar errors and present a summary of error frequencies.
Best Practices
- Log Level: Ensure appropriate log levels (e.g., INFO, WARN, ERROR) are used to capture relevant information.
- Structured Logging: Implement structured logging (e.g., JSON format) to facilitate efficient analysis.
- Log Rotation: Configure log rotation policies to prevent log files from growing excessively.
Integration
This skill can be integrated with other tools for monitoring and alerting. For example, it can be used in conjunction with a monitoring plugin to automatically trigger alerts based on log analysis results. It can also work with deployment tools to rollback deployments when critical errors are detected in the logs.
Prerequisites
- Access to application log files in ${CLAUDE_SKILL_DIR}/logs/
- Log parsing tools (grep, awk, sed)
- Understanding of application log format and structure
- Read permissions for log directories
Instructions
- Identify log files to analyze based on timeframe and application
- Extract relevant data (timestamps, durations, error messages)
- Apply pattern matching to identify slow requests and errors
- Aggregate and group similar issues
- Generate analysis report with findings and recommendations
- Suggest optimization opportunities based on patterns
Output
- Summary of slow requests with response times
- Error frequency reports grouped by type
- Resource usage patterns and anomalies
- Performance bottleneck identification
- Recommendations for log improvements and optimizations
Error Handling
If log analysis fails:
- Verify log file paths and permissions
- Check log format compatibility
- Validate timestamp parsing
- Ensure sufficient disk space for analysis
- Review log rotation configuration
Resources
- Application logging best practices
- Structured logging format guides
- Log aggregation tools documentation
- Performance analysis methodologies
1---
2name: analyzing-logs
3description: Analyze application logs for performance insights and issue detection including slow requests, error patterns, and resource usage. Use when troubleshooting performance issues or debugging errors. Trigger with phrases like "analyze logs", "find slow requests", or "detect error patterns".
4version: 1.0.0
5allowed-tools: "Read, Write, Bash(logs:*), Bash(grep:*), Bash(awk:*), Grep"
6license: MIT
7author: Jeremy Longshore <jeremy@intentsolutions.io>
8compatible-with: claude-code, codex, openclaw
9metadata:
10 source: https://skillmd.com/skills/micsapp/analyzing-logs
11---
12
13# Log Analysis Tool
14
15Analyze application logs to identify slow requests, recurring error patterns, and resource usage anomalies with structured reporting and optimization recommendations.
16
17## Overview
18
19This skill empowers Claude to automatically analyze application logs, pinpoint performance bottlenecks, and identify recurring errors. It streamlines the debugging process and helps optimize application performance by extracting key insights from log data.
20
21## How It Works
22
231. **Initiate Analysis**: Claude activates the log analysis tool upon detecting relevant trigger phrases.
242. **Log Data Extraction**: The tool extracts relevant data, including timestamps, request durations, error messages, and resource usage metrics.
253. **Pattern Identification**: The tool identifies patterns such as slow requests, frequent errors, and resource exhaustion warnings.
264. **Report Generation**: Claude presents a summary of findings, highlighting potential performance issues and optimization opportunities.
27
28## When to Use This Skill
29
30This skill activates when you need to:
31- Identify performance bottlenecks in an application.
32- Debug recurring errors and exceptions.
33- Analyze log data for trends and anomalies.
34- Set up structured logging or log aggregation.
35
36## Examples
37
38### Example 1: Identifying Slow Requests
39
40User request: "Analyze logs for slow requests."
41
42The skill will:
431. Activate the log analysis tool.
442. Identify requests exceeding predefined latency thresholds.
453. Present a list of slow requests with corresponding timestamps and durations.
46
47### Example 2: Detecting Error Patterns
48
49User request: "Find error patterns in the application logs."
50
51The skill will:
521. Activate the log analysis tool.
532. Scan logs for recurring error messages and exceptions.
543. Group similar errors and present a summary of error frequencies.
55
56## Best Practices
57
58- **Log Level**: Ensure appropriate log levels (e.g., INFO, WARN, ERROR) are used to capture relevant information.
59- **Structured Logging**: Implement structured logging (e.g., JSON format) to facilitate efficient analysis.
60- **Log Rotation**: Configure log rotation policies to prevent log files from growing excessively.
61
62## Integration
63
64This skill can be integrated with other tools for monitoring and alerting. For example, it can be used in conjunction with a monitoring plugin to automatically trigger alerts based on log analysis results. It can also work with deployment tools to rollback deployments when critical errors are detected in the logs.
65
66## Prerequisites
67
68- Access to application log files in ${CLAUDE_SKILL_DIR}/logs/
69- Log parsing tools (grep, awk, sed)
70- Understanding of application log format and structure
71- Read permissions for log directories
72
73## Instructions
74
751. Identify log files to analyze based on timeframe and application
762. Extract relevant data (timestamps, durations, error messages)
773. Apply pattern matching to identify slow requests and errors
784. Aggregate and group similar issues
795. Generate analysis report with findings and recommendations
806. Suggest optimization opportunities based on patterns
81
82## Output
83
84- Summary of slow requests with response times
85- Error frequency reports grouped by type
86- Resource usage patterns and anomalies
87- Performance bottleneck identification
88- Recommendations for log improvements and optimizations
89
90## Error Handling
91
92If log analysis fails:
93- Verify log file paths and permissions
94- Check log format compatibility
95- Validate timestamp parsing
96- Ensure sufficient disk space for analysis
97- Review log rotation configuration
98
99## Resources
100
101- Application logging best practices
102- Structured logging format guides
103- Log aggregation tools documentation
104- Performance analysis methodologies