jpskill.com
🛠️ 開発・MCP コミュニティ

log-analyzer

アプリケーションやサーバーのログ、エラー情報を分析して、根本原因や異常なパターンを特定し、障害対応やエラー調査、性能問題の解決に役立てるSkill。

📜 元の英語説明(参考)

Analyze application logs, server logs, and error traces to identify root causes, patterns, and anomalies. Use when debugging production incidents, investigating error spikes, parsing crash reports, or correlating events across multiple log sources. Trigger words: logs, errors, stack trace, crash, exception, debug, incident, 500 errors, timeout, latency spike.

🇯🇵 日本人クリエイター向け解説

一言でいうと

アプリケーションやサーバーのログ、エラー情報を分析して、根本原因や異常なパターンを特定し、障害対応やエラー調査、性能問題の解決に役立てるSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o log-analyzer.zip https://jpskill.com/download/15085.zip && unzip -o log-analyzer.zip && rm log-analyzer.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15085.zip -OutFile "$d\log-analyzer.zip"; Expand-Archive "$d\log-analyzer.zip" -DestinationPath $d -Force; ri "$d\log-analyzer.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して log-analyzer.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → log-analyzer フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

ログアナライザー

概要

アプリケーションとインフラストラクチャのログを解析、フィルタリング、分析して、本番環境の問題の根本原因を迅速に特定します。JSON構造化ログ、プレーンテキストサーバーログ、syslog形式、および複数行のスタックトレースを処理します。

手順

1. ログ形式の特定

ログがJSON(1行に1オブジェクト)、タイムスタンプ付きのプレーンテキスト、syslog、または混合形式のいずれであるかを検出します。一般的なパターンを探します。

  • JSON: {"timestamp":"...","level":"ERROR","message":"..."}
  • Syslog: Feb 17 14:23:01 hostname service[pid]: message
  • Plaintext: 2026-02-17 14:23:01.234 ERROR [thread] class - message

2. 関連エントリのフィルタリングと抽出

インシデントを調査する場合:

  • 時間範囲でフィルタリングします(例:アラート前の最後の30分)
  • 重要度(ERROR、FATAL、WARN)でフィルタリングします
  • 一意のエラーメッセージを抽出し、頻度でグループ化します
  • 各エラータイプの最初の発生を特定します

3. イベントの相関付け

因果関係の連鎖を探します。

  • 時間範囲内の最初のERRORは何でしたか?
  • ダウンストリームの障害に先行するアップストリームのエラーはありますか?
  • エラーは、デプロイイベント、構成の変更、またはトラフィックの急増と相関していますか?
  • サービス間でリクエストIDまたは相関IDを追跡します

4. 調査結果の要約

結果を次のように提示します。

## インシデントのタイムライン
- HH:MM:SS — 最初のERROR: [説明]
- HH:MM:SS — エラーカスケードの開始: [説明]
- HH:MM:SS — サービス劣化の検出

## 根本原因
[何がうまくいかなかったかの明確な説明]

## エラー分布
| Error Type | Count | First Seen | Last Seen |
|-----------|-------|------------|-----------|
| ConnectionTimeout | 1,247 | 14:02:03 | 14:31:45 |
| NullPointerException | 89 | 14:02:15 | 14:28:00 |

## 推奨されるアクション
1. [即時の修正]
2. [フォローアップ調査]

5. 大きなログファイルの処理

一度に読み込むには大きすぎるファイルの場合:

  • 最新の状態を確認するために、最後の500行から始めます
  • ERROR/FATAL/EXCEPTION キーワードを検索します
  • grepパターンを使用して、詳細な読み取りの前に範囲を絞り込みます
  • 定期的にサンプリングして、時間の経過に伴うパターンを検出します

例 1: API エラーの急増

入力: 「これらのアプリケーションログを分析してください。過去1時間に500エラーが急増しています」

ログの内容:

2026-02-17 13:58:22.001 INFO  [http-8080-12] c.a.OrderService - Processing order #98712
2026-02-17 13:58:22.450 ERROR [http-8080-12] c.a.OrderService - Failed to process order #98712: Connection refused to payment-service:8443
2026-02-17 13:58:22.451 ERROR [http-8080-12] c.a.ApiController - 500 Internal Server Error: PaymentServiceUnavailable
2026-02-17 13:58:23.100 WARN  [health-check] c.a.HealthMonitor - payment-service health check failed (attempt 3/3)
2026-02-17 13:58:23.101 ERROR [health-check] c.a.HealthMonitor - Circuit breaker OPEN for payment-service

出力:

## インシデントのタイムライン
- 13:58:22 — payment-service:8443 への最初の接続拒否
- 13:58:23 — ヘルスチェックで payment-service がダウンしていることを確認
- 13:58:23 — サーキットブレーカーがトリップ

## 根本原因
payment-service がポート 8443 で到達不能になり、すべての注文処理が ConnectionRefused エラーで失敗しました。3回連続のヘルスチェックの失敗後、サーキットブレーカーが開きました。

## 推奨されるアクション
1. payment-service ポッドのステータスと最近のデプロイメントを確認します
2. ポート 8443 のネットワークポリシーが変更されていないことを確認します
3. OOMキルまたはクラッシュループについて payment-service ログを確認します

例 2: メモリリークの検出

入力: 「当社のサービスは6時間ごとに再起動し続けています。これが最後のクラッシュに関するログです」

ログの内容:

2026-02-17 08:00:01.000 INFO  Heap usage: 512MB / 2048MB (25%)
2026-02-17 10:00:01.000 INFO  Heap usage: 1024MB / 2048MB (50%)
2026-02-17 12:00:01.000 INFO  Heap usage: 1720MB / 2048MB (84%)
2026-02-17 13:45:30.000 WARN  GC overhead limit exceeded, heap: 1980MB / 2048MB
2026-02-17 13:47:12.000 ERROR java.lang.OutOfMemoryError: Java heap space
2026-02-17 13:47:12.001 ERROR   at com.app.cache.SessionCache.put(SessionCache.java:142)

出力:

## 根本原因
SessionCache のメモリリーク — ヒープは、OOMキル前に約6時間かけて25%から97%まで直線的に増加します。142行目の SessionCache.put() メソッドが割り当てホットスポットです。

## エラー分布
| Metric | Value |
|--------|-------|
| Growth rate | ~250MB/hour |
| Time to OOM | ~6 hours |
| Leak source | SessionCache.put (line 142) |

## 推奨されるアクション
1. SessionCache の削除ポリシーを確認します — エントリが期限切れになっていない可能性があります
2. キャッシュに最大サイズ制限を追加します(例:maximumSize を使用した Caffeine)
3. OOM時にヒープダンプを有効にします: -XX:+HeapDumpOnOutOfMemoryError

ガイドライン

  • 常に最初にタイムラインを確立してください — 時系列順序で因果関係が明らかになります
  • 最も頻繁なエラーではなく、最初のERRORを探してください — カスケード障害が増幅されます
  • 相関IDとリクエストIDは、分散システムにとって最高の味方です
  • WARNレベルのメッセージを無視しないでください — それらはエラーに先行することがよくあります
  • ログが複数のサービスからのものである場合は、最初にサービスでグループ化し、次に関連付けます
  • 行番号、タイムスタンプ、およびエラー数について具体的に記述してください
  • 一般的な「さらに調査する」ではなく、具体的な次のステップを提案してください
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Log Analyzer

Overview

Parse, filter, and analyze application and infrastructure logs to quickly identify root causes of production issues. Handles JSON structured logs, plaintext server logs, syslog format, and multi-line stack traces.

Instructions

1. Identify log format

Detect whether logs are JSON (one object per line), plaintext with timestamps, syslog, or mixed format. Look for common patterns:

  • JSON: {"timestamp":"...","level":"ERROR","message":"..."}
  • Syslog: Feb 17 14:23:01 hostname service[pid]: message
  • Plaintext: 2026-02-17 14:23:01.234 ERROR [thread] class - message

2. Filter and extract relevant entries

When investigating an incident:

  • Filter by time window (e.g., last 30 minutes before the alert)
  • Filter by severity (ERROR, FATAL, WARN)
  • Extract unique error messages and group by frequency
  • Identify the first occurrence of each error type

3. Correlate events

Look for causal chains:

  • What was the FIRST error in the time window?
  • Are there upstream errors that preceded downstream failures?
  • Do errors correlate with deployment events, config changes, or traffic spikes?
  • Track request IDs or correlation IDs across services

4. Summarize findings

Present results as:

## Incident Timeline
- HH:MM:SS — First error: [description]
- HH:MM:SS — Error cascade begins: [description]
- HH:MM:SS — Service degradation detected

## Root Cause
[Clear explanation of what went wrong]

## Error Distribution
| Error Type | Count | First Seen | Last Seen |
|-----------|-------|------------|-----------|
| ConnectionTimeout | 1,247 | 14:02:03 | 14:31:45 |
| NullPointerException | 89 | 14:02:15 | 14:28:00 |

## Recommended Actions
1. [Immediate fix]
2. [Follow-up investigation]

5. Handle large log files

For files too large to read at once:

  • Start with the last 500 lines to see recent state
  • Search for ERROR/FATAL/EXCEPTION keywords
  • Use grep patterns to narrow scope before deep reading
  • Sample periodically to detect patterns over time

Examples

Example 1: API Error Spike

Input: "Analyze these application logs — we're seeing 500 errors spike in the last hour"

Log content:

2026-02-17 13:58:22.001 INFO  [http-8080-12] c.a.OrderService - Processing order #98712
2026-02-17 13:58:22.450 ERROR [http-8080-12] c.a.OrderService - Failed to process order #98712: Connection refused to payment-service:8443
2026-02-17 13:58:22.451 ERROR [http-8080-12] c.a.ApiController - 500 Internal Server Error: PaymentServiceUnavailable
2026-02-17 13:58:23.100 WARN  [health-check] c.a.HealthMonitor - payment-service health check failed (attempt 3/3)
2026-02-17 13:58:23.101 ERROR [health-check] c.a.HealthMonitor - Circuit breaker OPEN for payment-service

Output:

## Incident Timeline
- 13:58:22 — First connection refused to payment-service:8443
- 13:58:23 — Health check confirms payment-service is down
- 13:58:23 — Circuit breaker tripped

## Root Cause
payment-service became unreachable at port 8443, causing all order processing
to fail with ConnectionRefused errors. The circuit breaker opened after 3
consecutive health check failures.

## Recommended Actions
1. Check payment-service pod status and recent deployments
2. Verify network policies haven't changed for port 8443
3. Review payment-service logs for OOM kills or crash loops

Example 2: Memory Leak Detection

Input: "Our service keeps restarting every 6 hours, here are the logs around the last crash"

Log content:

2026-02-17 08:00:01.000 INFO  Heap usage: 512MB / 2048MB (25%)
2026-02-17 10:00:01.000 INFO  Heap usage: 1024MB / 2048MB (50%)
2026-02-17 12:00:01.000 INFO  Heap usage: 1720MB / 2048MB (84%)
2026-02-17 13:45:30.000 WARN  GC overhead limit exceeded, heap: 1980MB / 2048MB
2026-02-17 13:47:12.000 ERROR java.lang.OutOfMemoryError: Java heap space
2026-02-17 13:47:12.001 ERROR   at com.app.cache.SessionCache.put(SessionCache.java:142)

Output:

## Root Cause
Memory leak in SessionCache — heap grows linearly from 25% to 97% over ~6 hours
before OOM kill. The SessionCache.put() method at line 142 is the allocation hotspot.

## Error Distribution
| Metric | Value |
|--------|-------|
| Growth rate | ~250MB/hour |
| Time to OOM | ~6 hours |
| Leak source | SessionCache.put (line 142) |

## Recommended Actions
1. Review SessionCache eviction policy — entries may not be expiring
2. Add max-size bound to the cache (e.g., Caffeine with maximumSize)
3. Enable heap dump on OOM: -XX:+HeapDumpOnOutOfMemoryError

Guidelines

  • Always establish a timeline first — chronological order reveals causality
  • Look for the FIRST error, not the most frequent — cascading failures amplify
  • Correlation IDs and request IDs are your best friend for distributed systems
  • Don't ignore WARN-level messages — they often precede errors
  • When logs are from multiple services, group by service first, then correlate
  • Be specific about line numbers, timestamps, and error counts
  • Suggest concrete next steps, not generic "investigate further"