RousselTMLEARNING

TP · Splunk: from discovery to expertise

Lab: Investigate an incident with SPL

What you will learn in this TP
  • Aggregate and compare with stats and timechart
  • Categorize with eval and case
  • Compare each event with its group (eventstats)
  • Extract a field with rex
  • Enrich with a lookup
  • Count without reading events using tstats
Mode :

All steps and instructions are shown. Recommended for this lab: semi-guided

Introduction #

Context. Customers have been complaining about payment failures since yesterday. The manager wants to know which pages are affected, since when, which users, and whether a browser is involved.

Prerequisites: a machine with Docker (4 GB free memory), curl, jq and Python 3, Lab 1 completed  ·  Estimated time: 45 min

Six searches answering the incident questions, one enriched with a lookup table and one using tstats.

Setup #

Guided steps, with their solution.

  1. 1. Locate errors

    Why? Starting wide then narrowing avoids missing an affected page.

    Count server errors (5xx) per URL, then show their trend per 30-minute slot for the two most affected URLs.
  2. 2. Compute an error rate

    Why? The error count depends on traffic; the rate lets you compare pages with each other.

    For each URL, compute requests, 5xx errors, error rate in % and p95 of duration_ms, with a readable category using case().
  3. 3. Find abnormal requests

    Why? A fixed threshold does not suit every page: compare each request with its own URL's average.

    With eventstats, keep requests more than three times slower than their URL's average, and count them per URL and code.
  4. 4. Extract the browser

    Why? Useful data is often buried in a text field: rex makes it usable without touching ingestion.

    Extract the browser name and version from useragent, then check whether payment errors concern a particular browser.
  5. 5. Enrich with a lookup

    Why? A lookup table turns codes into labels everyone understands, without storing them in each event.

    Copy http_status.csv into the search app, then count requests per category and label using lookup.
  6. 6. Count with tstats

    Why? tstats reads index files: the right habit for dashboards and large volumes.

    Count web index events per hour and per host with tstats, then compare execution time with the equivalent stats search in the Job Inspector.

Validate your work

Check that each goal above is reached and that you get the result described in the introduction.

Difficulty level : ●●●○○ (3/5)

My progress

  • ⏱ Estimated time : ≈ 45 min

Sign in to track your progress and take notes. Sign in

⭐ Rate this lesson

5.0 initial rating from the teaching team

Sign in to rate this lesson →

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

Splunk best practices

Best practices for running Splunk in production: data quality and sourcetypes, index design, lice...

Advanced Grail and DQL: performance, parse, joins, time series, entities and correlation

Writing fast, low-cost DQL queries, parsing text with DPL and JSON, combining sources with lookup...

Sources, destinations and routes in Cribl Stream

Receiving and sending data with Cribl Stream: push, pull, collector and internal sources, event b...

Elastic path project: centralising and using logs

The validation project of the "Elastic Stack mastery" path: Elastic Agent and Fleet, Logstash, El...

Logs with OpenTelemetry: data model, appenders, correlation and collection

Master the log signal: the LogRecord data model, the Logs Bridge API and appenders (Logback, Log4...

Ansible: generating dynamic files with Jinja2 and facts

Create dynamic configuration files: Jinja2 templates, variables, facts, filters, loops, condition...

Exploring data in Discover: KQL, Lucene and ES|QL

Search and analyze logs in Kibana Discover: filters, KQL, Lucene syntax, and the ES|QL language t...

Thanos Ruler: rules and alerts on the global view

Evaluate recording and alerting rules across all clusters with Thanos Ruler: configuration, Alert...

Incidents and automation with Datadog: On-Call, Incident Management and Workflow Automation

Manage incidents in Datadog: well-designed monitors, on-call with On-Call, declaring and tracking...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!