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

Splunk: the machine data platform at a glance

Discover Splunk: the platform's role, components (forwarders, indexers, search heads), ports, eve...

Installing Splunk and ingesting data

Installing Splunk Enterprise (package or Docker), understanding $SPLUNK_HOME and configuration fi...

Dashboards, reports and alerts in Splunk

Making the most of Splunk searches: reports and scheduling, Dashboard Studio dashboards (data sou...

Splunk best practices

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

Administering distributed Splunk

Designing and administering a production Splunk platform: reference architectures, indexer cluste...

SPL: Splunk search fundamentals

Learning the SPL language: search structure, time range and time modifiers, search modes, filteri...

Sources, destinations and routes in Cribl Stream

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

Security and observability with Splunk

Splunk solutions beyond search: Enterprise Security (detections, findings, risk-based alerting, a...

Kibana: role, installation and first steps

What Kibana is in the Elastic suite, how to install it with Elasticsearch (start-local, Docker), ...

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!