巨大ログのエラー要約(型ごとに件数・発生時刻・スタック)

Log error summarizer: group errors by masked signature

大きなアプリ・サーバーログを読み、数値やIDを伏せた「エラーの型」ごとに件数・初回/最終発生・スタックフレーム・サンプル行をまとめます。

ClaudeHermes AgentCodexCursorMIT(改変・再配布・商用利用可)Python

できること

数十MB〜GB級のログをそのまま読ませる代わりに、「どんなエラーが、何件、いつからいつまで出ているか」を短い一覧にします。

  • 数値・UUID・IPアドレス・メールアドレス・URL・パスなどを伏せて正規化し、値だけが違う同じエラーを1つにまとめる
  • 件数・割合・初回/最終発生時刻・出現ファイル・例外行・よく出るスタックフレーム・生のサンプル行を表示
  • Python・Java・Node.js・Go・.NET・Ruby の複数行スタックトレースを元の行にひもづけ
  • テキストログと JSON Lines(level / msg / stack などのキーを自動判別)、.gz、複数ファイル、標準入力に対応
  • Markdown か JSON で出力

エージェントはこの要約をもとに、影響の大きい順に原因の見立てと次の確認手順を報告します。

使い方

python scripts/log_summary.py app.log
python scripts/log_summary.py "logs/*.log*" --levels WARN,ERROR,FATAL --top 20
python scripts/log_summary.py app.jsonl --json --out summary.json

Claude・Codex・Hermes Agent・Cursor に「このログのエラーをまとめて」と頼むと、このスキルの手順で実行・解釈します。

必要な環境

  • Python 3.10 以上(標準ライブラリのみ)

注意点

  • ログは読むだけで、変更・削除はしません。外部への送信もしません。
  • 伏せ字になるのは集計用のシグネチャだけで、サンプル行は元のままです。個人情報や秘密情報を共有するときは注意してください。
  • 独自形式のログでは、スタックトレースが別のエラーとして数えられることがあります。
English description

Read huge application or server logs and group errors by a masked signature with counts, first/last seen, top stack frames and sample lines.

What it does

Instead of reading a multi-megabyte log into context, get a short ranked list of which errors happen, how often, and when.

  • Normalizes messages by masking numbers, UUIDs, IPs, e-mails, URLs and paths, so the same error with different values becomes one signature
  • Shows count, share, first/last seen, files, exception line, most common stack frames and raw sample lines
  • Attaches multi-line stack traces (Python, Java, Node.js, Go, .NET, Ruby) to the record they belong to
  • Plain-text logs and JSON Lines (level / msg / stack keys auto-detected), .gz files, multiple files and stdin
  • Markdown or JSON output

The agent then explains likely causes in order of impact and proposes next checks.

How to use

python scripts/log_summary.py app.log
python scripts/log_summary.py "logs/*.log*" --levels WARN,ERROR,FATAL --top 20
python scripts/log_summary.py app.jsonl --json --out summary.json

Ask Claude, Codex, Hermes Agent or Cursor to "summarize the errors in this log" and it follows the skill's procedure.

Requirements

  • Python 3.10+ (standard library only)

Caveats

  • Read-only: logs are never modified or deleted, and nothing is sent over the network.
  • Only signatures are masked; sample lines are raw, so take care with personal data and secrets when sharing.
  • With unusual custom formats a stack trace may be counted as separate records.

インストール方法

  1. ダウンロードしたZIPを展開します(中に log-error-summarizer/ フォルダと SKILL.md があります)。
  2. フォルダごと、使うエージェントのスキル置き場にコピーします。
    • Claude:~/.claude/skills/(プロジェクト単位なら .claude/skills/)
    • Hermes Agent:~/.hermes/skills/
    • Codex:~/.agents/skills//Cursor:~/.cursor/skills/
    • Claude アプリ(claude.ai):「カスタマイズ → スキル」からZIPをアップロード
  3. エージェントを再起動し、スキル一覧に表示されることを確認します。

Windows・Mac 別、エージェント別のインストール手順

出品者

AI Skill Market 公式

出品スキル 44 件

出品者のプロフィールとスキル一覧