log-analyzer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLog Analyzer Skill
Log Analyzer Skill
アプリケーションログを分析し、問題を特定するスキルです。
A skill for analyzing application logs and identifying issues.
概要
Overview
大量のログファイルからエラー、警告、パターンを検出し、根本原因を分析します。
Detects errors, warnings, and patterns from large volumes of log files, and analyzes root causes.
主な機能
Key Features
- エラー検出: 例外、スタックトレース、エラーメッセージ
- パターン認識: 繰り返し発生する問題
- 時系列分析: エラーの発生傾向
- 根本原因分析: ログから問題の原因を推定
- 統計情報: エラー率、レスポンスタイム等
- アラート生成: 異常検知と通知
- ログレベル分類: ERROR、WARN、INFO、DEBUG
- Error Detection: Exceptions, stack traces, error messages
- Pattern Recognition: Recurring issues
- Time-series Analysis: Error occurrence trends
- Root Cause Analysis: Estimate issue causes from logs
- Statistical Information: Error rates, response times, etc.
- Alert Generation: Anomaly detection and notifications
- Log Level Classification: ERROR, WARN, INFO, DEBUG
使用方法
Usage
以下のログを分析:
[ログファイルの内容]
分析項目:
- エラーの種類と頻度
- 根本原因の推定
- 解決策の提案Analyze the following logs:
[Log file content]
Analysis items:
- Error types and frequency
- Root cause estimation
- Solution proposals分析例
Analysis Example
エラーログ分析
Error Log Analysis
入力ログ:
2024-06-15 10:23:45 ERROR [database] Connection timeout after 30s
2024-06-15 10:23:50 ERROR [database] Connection timeout after 30s
2024-06-15 10:24:12 ERROR [database] Connection timeout after 30s
2024-06-15 10:25:33 ERROR [api] Failed to fetch user data: Database unavailable
2024-06-15 10:25:34 ERROR [api] Failed to fetch user data: Database unavailable分析結果:
markdown
undefinedInput Log:
2024-06-15 10:23:45 ERROR [database] Connection timeout after 30s
2024-06-15 10:23:50 ERROR [database] Connection timeout after 30s
2024-06-15 10:24:12 ERROR [database] Connection timeout after 30s
2024-06-15 10:25:33 ERROR [api] Failed to fetch user data: Database unavailable
2024-06-15 10:25:34 ERROR [api] Failed to fetch user data: Database unavailableAnalysis Result:
markdown
undefinedログ分析レポート
Log Analysis Report
サマリー
Summary
- 分析期間: 2024-06-15 10:23:45 - 10:25:34 (2分間)
- 総ログ数: 450行
- エラー数: 5件
- 警告数: 12件
- Analysis Period: 2024-06-15 10:23:45 - 10:25:34 (2 minutes)
- Total Logs: 450 lines
- Error Count: 5
- Warning Count: 12
検出された問題
Detected Issues
[CRITICAL] データベース接続タイムアウト
[CRITICAL] Database Connection Timeout
頻度: 3回(10:23:45 - 10:24:12)
影響: API リクエスト失敗(2件)
ログパターン:
ERROR [database] Connection timeout after 30s根本原因(推定):
- データベースサーバーの過負荷
- ネットワーク接続の問題
- コネクションプールの枯渇
推奨アクション:
- データベースのCPU/メモリ使用率を確認
- スロークエリログをチェック
- コネクションプールサイズを確認
- ネットワーク遅延を計測
Frequency: 3 times (10:23:45 - 10:24:12)
Impact: API request failures (2 cases)
Log Pattern:
ERROR [database] Connection timeout after 30sEstimated Root Causes:
- Database server overload
- Network connection issues
- Connection pool exhaustion
Recommended Actions:
- Check database CPU/memory usage
- Review slow query logs
- Verify connection pool size
- Measure network latency
[HIGH] API エラー連鎖
[HIGH] API Error Chain
頻度: 2回(DB タイムアウト後に発生)
原因: データベース障害の波及
Frequency: 2 times (occurred after DB timeout)
Cause: Impact of database failure
時系列分析
Time-series Analysis
10:23 ├─ DB接続タイムアウト開始
10:24 ├─ DB接続タイムアウト継続
10:25 ├─ API エラー発生(DB不可)
└─ ユーザーリクエスト失敗10:23 ├─ DB connection timeout starts
10:24 ├─ DB connection timeout continues
10:25 ├─ API error occurs (DB unavailable)
└─ User request failure統計情報
Statistical Information
| メトリクス | 値 |
|---|---|
| エラー率 | 1.1% (5/450) |
| 平均レスポンス | 245ms |
| 最大レスポンス | 30,012ms (timeout) |
| 成功率 | 98.9% |
| Metric | Value |
|---|---|
| Error Rate | 1.1% (5/450) |
| Average Response | 245ms |
| Maximum Response | 30,012ms (timeout) |
| Success Rate | 98.9% |
推奨対応
Recommended Responses
即時対応
Immediate Actions
- データベース接続状況の確認
- アプリケーション再起動(接続プールリセット)
- データベースのパフォーマンス確認
- Check database connection status
- Restart application (reset connection pool)
- Verify database performance
短期対応
Short-term Actions
- コネクションプールサイズの最適化
- タイムアウト値の見直し
- リトライロジックの実装
- Optimize connection pool size
- Review timeout values
- Implement retry logic
長期対応
Long-term Actions
- データベースのスケーリング
- 読み取りレプリカの追加
- キャッシュ層の導入
undefined- Scale the database
- Add read replicas
- Introduce cache layer
undefinedサポートログ形式
Supported Log Formats
- 一般形式: syslog, Apache, Nginx
- アプリケーション: Log4j, Winston, Python logging
- クラウド: CloudWatch, Stackdriver
- JSON: 構造化ログ
- General Formats: syslog, Apache, Nginx
- Applications: Log4j, Winston, Python logging
- Cloud: CloudWatch, Stackdriver
- JSON: Structured logs
ベストプラクティス
Best Practices
- 構造化ログ: JSON形式で統一
- 適切なレベル: ERROR、WARN、INFO を使い分け
- コンテキスト: リクエストID、ユーザーIDを含める
- 集約: ログ集約ツール(ELK、Splunk)使用
- Structured Logs: Standardize in JSON format
- Appropriate Levels: Use ERROR, WARN, INFO appropriately
- Context: Include request IDs, user IDs
- Aggregation: Use log aggregation tools (ELK, Splunk)
バージョン情報
Version Information
- スキルバージョン: 1.0.0
- 最終更新: 2025-01-22
- Skill Version: 1.0.0
- Last Updated: 2025-01-22