splunk-analysis

Analyze Splunk logs using SPL queries, statistics, and strategic sampling for incident investigation.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill splunk-analysis-erwinv2k-tkg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: splunk-analysis
Source: https://github.com/erwinv2k-TKG/AgentesVSC/tree/main/packs/incidentfox/sre-agent/.claude/skills/observability-splunk
Command: npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill splunk-analysis-erwinv2k-tkg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires httpx, and includes scripts (resource) components.

What problem does it solve? Investigating production incidents in Splunk often leads to dumping raw logs without context, wasting time and missing root causes. This Skill enforces a statistics-first workflow so you understand log volume, error rates, and top error patterns before sampling any events. ## Core Features & Use Cases - Statistics-First Investigation: The get_statistics.py script reports total count, error rate, level distribution, top sourcetypes, hosts, and normalized error patterns with an actionable recommendation. - Strategic Log Sampling: The sample_logs.py script supports errors_only, warnings_up, around_time, and all strategies to fetch only relevant events. - SPL Reference: Built-in guidance for filtering, aggregation, anomaly detection, and common query patterns like error rate analysis and response time percentiles. - Use Case: During an outage, run get_statistics.py on the affected index, spot a 12% error rate dominated by one pattern, then sample errors around the spike timestamp to confirm the root cause. ## Quick Start Ask the agent to investigate errors in the main Splunk index over the last hour, starting with statistics and then sampling only error logs.

Frequently Asked Questions about splunk-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I investigate errors in Splunk logs efficiently?

Start with get_statistics.py to get total count, error rate, and top error patterns before fetching any raw logs. Then use sample_logs.py with the errors_only strategy to inspect only relevant events, avoiding unbounded searches.

How to write SPL queries for error rate analysis?

Use timechart with a conditional count, such as count(eval(level="ERROR")), divided by total count to compute error percentage over time. Always specify an index and a bounded time range for performance.

What Splunk authentication methods are supported?

The client supports bearer tokens via SPLUNK_TOKEN, basic auth via SPLUNK_USER and SPLUNK_PASSWORD, and a proxy mode where credentials are injected transparently using tenant context headers. Direct mode uses SPLUNK_URL for testing.

Why should I avoid dumping raw Splunk logs during an incident?

Raw log dumps lack context about volume and error distribution, making root cause analysis slow and noisy. The statistics-first approach surfaces top error patterns and rates so sampling targets only the anomalies that matter.

Can I sample Splunk logs around a specific timestamp?

Yes, use sample_logs.py with the around_time strategy, passing --timestamp and an optional --window in minutes. This fetches logs surrounding an anomaly, which is useful for correlating events during a spike.