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
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 usingtstats.Setup #
Guided steps, with their solution.
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. 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 ofduration_ms, with a readable category usingcase().3. Find abnormal requests
Why? A fixed threshold does not suit every page: compare each request with its own URL's average.
Witheventstats, keep requests more than three times slower than their URL's average, and count them per URL and code.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 fromuseragent, then check whether payment errors concern a particular browser.5. Enrich with a lookup
Why? A lookup table turns codes into labels everyone understands, without storing them in each event.
Copyhttp_status.csvinto the search app, then count requests per category and label usinglookup.6. Count with tstats
Why? tstats reads index files: the right habit for dashboards and large volumes.
Countwebindex events per hour and per host withtstats, then compare execution time with the equivalentstatssearch 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
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
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...