Initial commit
This commit is contained in:
64
commands/logs.md
Normal file
64
commands/logs.md
Normal file
@@ -0,0 +1,64 @@
|
||||
---
|
||||
description: Analyze enterprise system logs for troubleshooting and monitoring
|
||||
argument-hint: [service] [level] [timeframe]
|
||||
---
|
||||
|
||||
# Enterprise Log Analysis
|
||||
|
||||
Analyze system logs for troubleshooting, monitoring, and security analysis.
|
||||
|
||||
## Context
|
||||
- Recent system logs: !`journalctl --no-pager -n 100 --since "1 hour ago"`
|
||||
- Application logs: !`tail -n 50 /var/log/application.log 2>/dev/null || echo "Application logs not found"`
|
||||
- Error logs: !`grep -i error /var/log/syslog 2>/dev/null | tail -20 || echo "No recent errors found"`
|
||||
- Security logs: !`grep -i "failed\|denied\|unauthorized" /var/log/auth.log 2>/dev/null | tail -10 || echo "No security events found"`
|
||||
- Web server logs: !`tail -n 20 /var/log/nginx/access.log 2>/dev/null || tail -n 20 /var/log/apache2/access.log 2>/dev/null || echo "Web server logs not found"`
|
||||
|
||||
## Your task
|
||||
|
||||
Based on the log information above, provide a comprehensive log analysis including:
|
||||
|
||||
1. **Log Summary**
|
||||
- Total log entries analyzed
|
||||
- Log levels distribution (ERROR, WARN, INFO, DEBUG)
|
||||
- Time range covered
|
||||
- Key patterns and trends
|
||||
|
||||
2. **Error Analysis**
|
||||
- Critical errors requiring immediate attention
|
||||
- Warning patterns and trends
|
||||
- Error frequency and impact assessment
|
||||
- Root cause analysis for recurring issues
|
||||
|
||||
3. **Security Analysis**
|
||||
- Failed authentication attempts
|
||||
- Unauthorized access attempts
|
||||
- Suspicious activity patterns
|
||||
- Security event correlation
|
||||
|
||||
4. **Performance Analysis**
|
||||
- Response time patterns
|
||||
- Resource usage spikes
|
||||
- Performance bottlenecks
|
||||
- Capacity planning insights
|
||||
|
||||
5. **Recommendations**
|
||||
- Immediate actions for critical issues
|
||||
- Log monitoring improvements
|
||||
- Alert configuration suggestions
|
||||
- Troubleshooting guidance
|
||||
|
||||
## Arguments
|
||||
- `service`: Specific service logs to analyze (optional)
|
||||
- `level`: Log level filter (error, warn, info, debug, optional)
|
||||
- `timeframe`: Time range for analysis (1h, 6h, 24h, 7d, optional)
|
||||
|
||||
## Usage Examples
|
||||
```
|
||||
/logs
|
||||
/logs database error
|
||||
/logs api warn 24h
|
||||
/logs security 7d
|
||||
```
|
||||
|
||||
Focus on enterprise-grade log analysis with actionable insights for system reliability, security, and performance optimization.
|
||||
Reference in New Issue
Block a user