RousselTMLEARNING

TP · Splunk: from discovery to expertise

Lab: Universal Forwarder, parsing, masking and filtering

What you will learn in this TP
  • Define a sourcetype with the essential settings
  • Mask data at index time with SEDCMD
  • Drop events with transforms.conf and nullQueue
  • Deploy a Universal Forwarder and check its connection
  • Measure the effect on indexed volume
Mode :

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

Introduction #

Context. An application writes text logs containing customer e-mail addresses and many DEBUG lines. The DPO requires that no address is indexed, and the license must not be wasted.

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

The application logs reach the app index through a Universal Forwarder, with a correct timestamp, without e-mail addresses and without DEBUG lines.

Setup #

Guided steps, with their solution.

  1. 1. Configure parsing on the indexer

    Why? The Universal Forwarder does not parse: masking and filtering apply where data is broken into events, here the indexer, and before it arrives.

    In a tp_app app, write props.conf (tp:app sourcetype, timestamp, SEDCMD, TRANSFORMS, extraction) and transforms.conf (nullQueue), create the app index, check with btool and restart Splunk.
  2. 2. Start the application

    Why? A continuous generator lets you see the rules' effect live, as in production.

    Start the script writing one line per second to ~/splunk-tp/logs/app.log: one in five at DEBUG, one in five at ERROR, all with an e-mail address.
  3. 3. Deploy the forwarder

    Why? The forwarder follows the file, remembers its position and sends a compressed stream to the indexer's port 9997.

    Put Splunk and the forwarder on the same Docker network, run splunk/universalforwarder:10.6.2 with the log folder read-only, then check the active connection and the monitor input.
  4. 4. Check masking and filtering

    Why? A compliance rule is proven by a search, not by reading a configuration file.

    After two minutes, check in the app index: breakdown per level (no DEBUG), no e-mail address, extracted fields and gap between _time and _indextime.
  5. 5. Measure the gain

    Why? Volume reduction can be quantified: that is the argument that convinces management and the security team.

    Compare lines written to app.log with indexed events over the same period, then find the index in the license log. Finally stop the generator and the forwarder.

Validate your work

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

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

My progress

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

Installing Splunk and ingesting data

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

Splunk: the machine data platform at a glance

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

Splunk best practices

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

Log collection best practices with Fluent Bit and Vector

Production checklist for log collection: structure, filtering at the source, masking, buffers, la...

Reducing, transforming and optimizing volumes with Cribl

Reducing the volume sent to SIEMs and observability tools without losing useful information: Drop...

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

SPL: Splunk search fundamentals

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

OpenTelemetry Collector: processors (transforming, filtering and protecting telemetry)

Master OpenTelemetry Collector processors: batch, memory_limiter, attributes, resource, filter, t...

Advanced SPL and knowledge objects

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

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!