RousselTMLEARNING

TP · Splunk: from discovery to expertise

Lab: Install Splunk and ingest logs via HEC

What you will learn in this TP
  • Run Splunk Enterprise in a container
  • Create an index and set its retention
  • Create an HEC token limited to one index
  • Send events and find them with SPL
Mode :

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

Introduction #

Context. Your team wants to centralize the online shop's logs. You set up a test Splunk, create a dedicated index and connect the application through the HTTP Event Collector.

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

A local Splunk 10.6 with a 30-day retention web index holding 3,000 events received via HEC.

Setup #

Guided steps, with their solution.

  1. 1. Run Splunk

    Why? The official container configures Splunk at startup: license, general terms, password and HEC enabled.

    Run splunk/splunk:10.6.2 with ports 8000, 8088, 8089 and 9997, wait for the healthy state (2 to 3 minutes) and print the version via the API.
  2. 2. Create the index and token

    Why? A dedicated index carries its own permissions and retention; a token limited to that index prevents an application from writing elsewhere.

    Through the REST API, create the web index (30-day retention) then an HEC token tp_web whose default and only allowed index is web.
  3. 3. Send events

    Why? HEC accepts several JSON events in one request: batch sending is much more efficient.

    Generate 3,000 access events spread over the last 24 hours and send them in batches of 500. Each response must be {"text":"Success","code":0}.
  4. 4. Search

    Why? Checking the event count and fields validates the whole chain: token, index, timestamp and JSON extraction.

    Log in to http://localhost:8000 (admin). Count events in the web index over 24 hours, per host, and display the list of extracted fields.
  5. 5. Check via the API

    Why? Automating a check through the API is the basis of platform acceptance tests.

    Run the same search through /services/search/jobs/export as CSV, then check the index size with | rest.

Validate your work

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

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

My progress

  • ⏱ Estimated time : ≈ 40 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

Advanced SPL and knowledge objects

Going further with Splunk: CSV and KV store lookups, eventstats and streamstats, transaction vers...

The observability trilemma: cost, completeness and performance, and how solutions resolve it

Understanding the observability trilemma (cost, data completeness, query performance), its three ...

Observability on AWS: CloudWatch, X-Ray, Application Signals, ADOT, Managed Prometheus and Grafana

A complete overview of observability on AWS: CloudWatch components (metrics, logs, alarms, Applic...

Cribl Edge: collecting close to the sources

Deploying Cribl Edge on Linux, Windows and Kubernetes: the agent's role, Fleets and Subfleets, co...

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...

Installing OpenObserve and ingesting your first data

Install OpenObserve with Docker Compose or the binary, configure it with its ZO_* variables, send...

Elastic path project: centralising and using logs

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

Archiving, replaying and searching: S3, Replay, Cribl Lake and Cribl Search

Keeping all data cheaply and finding it on demand: partitioned S3 destination, JSON and Parquet f...

Mimir: compactor, retention and object storage

Configure Mimir object storage (S3, GCS, Azure, MinIO), understand compaction and split-and-merge...

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!