跳到正文
cccskills
免费在 GitHub 公开

network-incident-analyzer

Analyze network device logs to identify connectivity issues, latency problems, and outages. Correlate timestamps across timezones, detect anomaly patterns, and generate incident reports with root cause hypotheses. Use when troubleshooting network incidents from log files.

中文简介正在准备中。当前显示原文说明。

实测评分 未实测

查看安装方法

包含的文件(6)

  • SKILL.md6.6 KB
  • references/anomaly-patterns.md8.8 KB
  • references/log-formats.md6.7 KB
  • scripts/analyze_network_logs.py47.8 KB
  • scripts/tests/conftest.py228 B
  • scripts/tests/test_analyze_network_logs.py20.9 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Network Incident Analyzer

Overview

Analyzes network device logs (routers, switches, firewalls, load balancers) to identify connectivity issues, latency problems, and service outages. Automatically correlates events across multiple log files with different timestamp formats and timezones, detects anomaly patterns within specified time windows, and generates comprehensive incident reports with root cause hypotheses and remediation recommendations.

When to Use

  • Troubleshooting network connectivity issues using device logs
  • Analyzing multiple log files from different network devices to find correlated events
  • Investigating service outages with logs spanning multiple timezones
  • Identifying patterns in network latency or packet loss from log data
  • Generating incident reports with root cause analysis from raw logs
  • Correlating timestamps across devices with different time formats

Prerequisites

  • Python 3.9+
  • No API keys required
  • Standard library only (datetime, re, json, collections, pathlib)

Workflow

Step 1: Collect Log Files

Gather all relevant network device logs for the incident time window. Supported formats include:

  • Cisco IOS/NX-OS logs
  • Juniper JunOS logs
  • Palo Alto firewall logs
  • F5 load balancer logs
  • Generic syslog format
  • JSON-structured logs

Place log files in a working directory or provide paths directly.

Step 2: Analyze Logs with Time Window

Run the analysis script specifying the incident time window and log files.

python3 scripts/analyze_network_logs.py \
  --logs /path/to/router.log /path/to/firewall.log \
  --start "2024-01-15 10:00:00" \
  --end "2024-01-15 12:00:00" \
  --timezone "America/New_York" \
  --output-dir ./incident-report

The script will:

  1. Parse each log file and detect its timestamp format
  2. Normalize all timestamps to UTC for correlation
  3. Identify anomaly patterns (high error rates, connection failures, latency spikes)
  4. Correlate events across devices within configurable time windows
  5. Generate incident timeline and root cause hypotheses

Step 3: Review Correlated Events

Examine the correlated_events.json output showing event clusters:

cat ./incident-report/correlated_events.json | python3 -m json.tool

Each cluster groups related events from different devices occurring within the correlation window.

Step 4: Analyze Root Cause Hypotheses

Review the root_cause_analysis.md report containing:

  • Incident timeline with key events
  • Detected anomaly patterns
  • Root cause hypotheses ranked by confidence
  • Recommended remediation steps

Step 5: Generate Executive Summary

For stakeholder communication, use the generated incident_summary.md:

  • Impact assessment (duration, affected services)
  • Timeline of key events
  • Root cause determination
  • Prevention recommendations

Output Format

JSON Report (correlated_events.json)

{
  "schema_version": "1.0",
  "analysis_timestamp": "2024-01-15T14:30:00Z",
  "incident_window": {
    "start": "2024-01-15T15:00:00Z",
    "end": "2024-01-15T17:00:00Z"
  },
  "log_files_analyzed": [
    {"path": "router.log", "events": 1523, "format": "cisco_ios"},
    {"path": "firewall.log", "events": 842, "format": "palo_alto"}
  ],
  "anomalies_detected": [
    {
      "type": "connection_failure_spike",
      "start_time": "2024-01-15T15:23:45Z",
      "end_time": "2024-01-15T15:45:12Z",
      "severity": "critical",
      "affected_devices": ["core-router-01", "fw-edge-01"],
      "event_count": 234
    }
  ],
  "correlated_events": [
    {
      "cluster_id": "CLU-001",
      "correlation_confidence": 0.92,
      "events": [
        {"timestamp": "2024-01-15T15:23:45Z", "device": "core-router-01", "message": "BGP peer down"},
        {"timestamp": "2024-01-15T15:23:47Z", "device": "fw-edge-01", "message": "Connection timeout"}
      ]
    }
  ],
  "root_cause_hypotheses": [
    {
      "hypothesis": "BGP session failure caused cascading connectivity loss",
      "confidence": 0.85,
      "supporting_evidence": ["BGP peer down event preceded all connection failures"],
      "recommended_actions": ["Check BGP neighbor configuration", "Verify upstream provider status"]
    }
  ]
}

Markdown Report (root_cause_analysis.md)

The report includes:

  • Executive summary
  • Incident timeline (chronological event listing)
  • Anomaly pattern analysis
  • Root cause hypotheses with confidence scores
  • Device-by-device findings
  • Remediation recommendations
  • Prevention measures

Resources

  • scripts/analyze_network_logs.py -- Main analysis script for parsing and correlating network logs
  • references/log-formats.md -- Supported log formats and parsing patterns
  • references/anomaly-patterns.md -- Documented anomaly detection patterns and thresholds

Key Principles

  1. Timezone Normalization -- All timestamps converted to UTC before correlation to ensure accurate event sequencing across devices in different timezones
  2. Multi-Source Correlation -- Events from different devices correlated using configurable time windows (default 30 seconds) to identify related incidents
  3. Pattern-Based Detection -- Anomalies detected using statistical thresholds (error rate spikes, connection failure clusters, latency outliers)
  4. Hypothesis Generation -- Root causes ranked by supporting evidence count and temporal correlation strength
  5. Actionable Output -- Reports include specific remediation steps and prevention recommendations

Supported Log Formats

FormatExample PatternAuto-Detection
Cisco IOS*Mar 15 10:23:45.123: %LINK-3-UPDOWN:Yes
Juniper JunOSMar 15 10:23:45 router rpd[1234]:Yes
Palo AltoMar 15 10:23:45,INFO,TRAFFIC,Yes
F5 BIG-IPMar 15 10:23:45 bigip info tmm[1234]:Yes
Generic Syslog<134>Mar 15 10:23:45 hostname process:Yes
JSON Structured{"timestamp": "...", "level": "...", "message": "..."}Yes

Anomaly Detection Thresholds

Default thresholds (configurable via --config flag):

  • Error Rate Spike: >3x baseline error rate within 5-minute window
  • Connection Failures: >50 failures within 1-minute window
  • Latency Anomaly: >2 standard deviations from rolling 10-minute average
  • Device Unreachable: No logs from device for >2 minutes after consistent activity

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Track and update action item status from natural language updates like 'Seanのメールには返信しておいた' or 'Lu対応予定'. Integrates with daily-comms-ops workflow. Use when managing action items across communication channels.

中文简介正在准备中。当前显示原文说明。

takusaotome/claude-skills-library102026年10月23日 更新

AI活用提案の専門コンサルタントスキル。LLM・AIエージェントの活用事例知識を基に、業界別、部門別、シーン別に最適なAI導入提案を行います。システム化、業務改善、効率化を得意とし、具体的な活用事例、期待効果、導入ステップを含む実践的な提案を提供します。Use when proposing AI/LLM adoption strategies for specific industries, departments, or business scenarios.

中文简介正在准备中。当前显示原文说明。

takusaotome/claude-skills-library102026年10月23日 更新

Generate AI-powered BPO service proposals for Japanese companies in the US market. Use when creating outsourcing proposals with AI service menus, ROI estimation, implementation roadmaps, and bilingual (JA/EN) proposal documents for 在米日系企業向けAI実装.

中文简介正在准备中。当前显示原文说明。

takusaotome/claude-skills-library102026年10月23日 更新

AI(LLM)が生成した日本語テキストの「AI臭」を検出・診断し、人間らしい文章にリライトするスキル。 Use when: 「AIっぽい文章を直して」「人間らしくリライトして」「AI臭を消して」「この文章をもっと自然にして」 「テキストのAI感を減らして」「機械っぽさを取りたい」 "make this sound more human", "remove AI tone", "humanize this text", "detect if this is AI-generated". 6つのAI特有パターン(視覚的マーカー、単調なリズム、マニュアル的構成、非コミット姿勢、抽象語の濫用、 定型メタファー)を正規表現ベースで検出し、0-100のAI臭スコアを算出。3つの人間化技法 (バランスを崩す・客観を崩す・論理を崩す)でリライトを実行する。 Note: 検出スクリプトは日本語テキスト専用。英語テキストの場合はClaude自身がreferences/を参照して分析・リライトする。

中文简介正在准备中。当前显示原文说明。

takusaotome/claude-skills-library102026年10月23日 更新

Generate audit-ready internal control design documents from As-Is business process inventories. Produces control IDs, assertion mappings, procedures, SoD analysis, KPIs, materiality thresholds, and implementation roadmaps. Use when building internal controls for new audit engagements, SOX/J-SOX compliance, or process improvement initiatives.

中文简介正在准备中。当前显示原文说明。

takusaotome/claude-skills-library102026年10月23日 更新

Review audit-related documents (control design documents, bottleneck analyses, requirements definitions, etc.) for quality, scoring them 0-100 with a severity-rated findings list. Use when reviewing audit documents, checking control design quality, or verifying cross-document consistency. Supports documents governed by US GAAP, IFRS, or J-GAAP.

中文简介正在准备中。当前显示原文说明。

takusaotome/claude-skills-library102026年10月23日 更新

查看 takusaotome 的全部技能

报告此技能的问题