Generate and execute Python code to analyze large log datasets, detect patterns, and extract actionable insights
Purpose: Generate and execute Python code to analyze large log datasets, detect patterns, and extract actionable insights.
When to Use: When you need to analyze 500+ log entries, detect error patterns, calculate statistics, or perform time-series analysis on log data.
π¨ CRITICAL SECURITY RULE:
ALL file paths MUST be relative to project directory and start with analytics/
NEVER use /tmp/, /private/tmp/, or any paths outside the project workspace
This skill guides you through:
CRITICAL: This skill uses progressive disclosure. You MUST read phase files in order.
MANDATORY FIRST STEP:
Before using any tools, use the Read tool to read:
.claude/skills/log-analytics/phases/data-fetch.md
This file contains Phase 1 instructions and tells you which file to read next.
DO NOT proceed with tool calls until you've read Phase 1.
The complete workflow consists of 3 phases:
phases/data-fetch.mdphases/code-generation.mdphases/analysis-execution.mdEach phase file contains a "Next Step" section directing you to the next phase.
Progressive Disclosure: Phase files reveal detailed instructions progressively. Read each phase file in sequence - do not skip ahead or assume you know what to do.
Dynamic Code Generation: Generate Python code based on the ACTUAL log structure returned. Don't use generic templates.
Structured Output: Always provide analysis results in JSON format with counts, percentages, and trends.
Save Your Work: Save generated scripts to analytics/ directory for reuse and auditing.
By the end of this skill execution, you will have:
analytics/incident_logs.jsonanalytics/parse_logs_[timestamp].pyThis skill can be invoked by other skills (e.g., incident-analysis) when they need deep log analysis.
From incident-analysis skill:
When log data exceeds 500 entries, invoke the log-analytics skill:
Use Skill tool β "log-analytics"
This skill requires the log-analytics-server MCP server, which provides:
get_raw_logs(incident_id, timeframe) - Fetch large log datasetsexecute_analysis_script(script_path) - Run generated Python codeReady to begin?
Use the Read tool to read: .claude/skills/log-analytics/phases/data-fetch.md