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
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 theapp index through a Universal Forwarder, with a correct timestamp, without e-mail addresses and without DEBUG lines.Setup #
Guided steps, with their solution.
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 atp_appapp, writeprops.conf(tp:appsourcetype, timestamp,SEDCMD,TRANSFORMS, extraction) andtransforms.conf(nullQueue), create theappindex, check withbtooland restart Splunk.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. 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, runsplunk/universalforwarder:10.6.2with the log folder read-only, then check the active connection and themonitorinput.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 theappindex: breakdown per level (no DEBUG), no e-mail address, extracted fields and gap between_timeand_indextime.5. Measure the gain
Why? Volume reduction can be quantified: that is the argument that convinces management and the security team.
Compare lines written toapp.logwith 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
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
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...