RousselTMLEARNING

Article · Splunk: from discovery to expertise

Installing Splunk and ingesting data

1. Installing #

Package, archive or container.

Docker #

docker run -d --name splunk -p 8000:8000 -p 8088:8088 -p 8089:8089 -p 9997:9997 \
  -e SPLUNK_START_ARGS=--accept-license \
  -e SPLUNK_GENERAL_TERMS=--accept-sgt-current-at-splunk-com \
  -e SPLUNK_PASSWORD="$SPLUNK_PASSWORD" -e SPLUNK_ENABLE_LISTEN=9997 \
  splunk/splunk:10.6.2
  • Since 2025, the image requires explicit acceptance of the general terms (SPLUNK_GENERAL_TERMS) in addition to the license.
  • On Linux: .rpm/.deb package or .tgz archive in /opt/splunk, dedicated splunk user, start with splunk enable boot-start -systemd-managed 1.
  • The web UI listens on port 8000; the management REST API on 8089.

$SPLUNK_HOME and configuration #

LocationContent
etc/system/defaultshipped values: never edit
etc/system/localinstance-wide settings
etc/apps/<app>/default, localan app's configuration (local wins over default)
etc/deployment-appsapps distributed by the deployment server
var/lib/splunkindex data (default)

For global settings (indexing), precedence is: system/local > apps/*/local > apps/*/default > system/default. splunk btool props list --debug shows the effective value and the file providing it.

Best practice : Put your configuration in a dedicated app (etc/apps/org_inputs/local) rather than system/local: it can be versioned, deployed and removed as a unit.

2. Indexes and retention #

Where and for how long.

Buckets #

Bucket lifecycle
# indexes.conf
[web]
homePath   = $SPLUNK_DB/web/db
coldPath   = $SPLUNK_DB/web/colddb
thawedPath = $SPLUNK_DB/web/thaweddb
frozenTimePeriodInSecs = 7776000      # 90 days, then frozen (deleted by default)
maxTotalDataSizeMB = 200000           # index size cap
  • One index per data population sharing access rights and retention (web, security, applications); not one index per server.
  • The first limit reached (age or size) triggers freezing; without coldToFrozenDir, frozen data is deleted.
  • SmartStore puts warm buckets on object storage (S3) with a local cache: the indexer becomes almost stateless.
  • Metrics indexes (datatype = metric) store numeric series queried with mstats.

3. Collecting #

Inputs, HEC and forwarders.

Inputs #

# inputs.conf
[monitor:///var/log/shop/*.log]
index = web
sourcetype = app:json

[udp://514]
index = network
sourcetype = syslog
connection_host = ip
  • monitor follows files (resuming at the read position); TCP/UDP receives from the network; scripted and modular inputs poll APIs.
  • For high-volume syslog, prefer a dedicated collector (Splunk Connect for Syslog, SC4S) rather than a UDP port on the indexer.

HTTP Event Collector #

curl -k https://splunk:8088/services/collector/event \
  -H "Authorization: Splunk $HEC_TOKEN" \
  -d '{"time": 1763900000, "host": "web-01", "sourcetype": "app:json", "index": "web", "event": {"status": 500, "uri": "/api/paiement"}}'

Each HEC token has a default index and a list of allowed indexes. The /services/collector/raw endpoint accepts raw text; indexer acknowledgment guarantees an event was written.

Universal Forwarder #

# outputs.conf du forwarder
[tcpout]
defaultGroup = indexeurs
[tcpout:indexeurs]
server = idx1:9997, idx2:9997, idx3:9997
useACK = true

# deploymentclient.conf : piloté par le serveur de déploiement
[target-broker:deploymentServer]
targetUri = ds.exemple.fr:8089

The forwarder automatically spreads sends across indexers (auto load balancing). The deployment server distributes collection apps to forwarders according to server classes (serverclass.conf).

4. Parsing: props.conf and transforms.conf #

Break, timestamp, filter, mask.

The pipeline #

Ingestion pipeline
# props.conf (indexer or heavy forwarder)
[app:json]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)
TIME_PREFIX = "ts":"
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%3N%z
MAX_TIMESTAMP_LOOKAHEAD = 40
TRUNCATE = 20000
SEDCMD-masque_email = s/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+/***@***/g
TRANSFORMS-sans_debug = drop_debug

# transforms.conf
[drop_debug]
REGEX = "level":"DEBUG"
DEST_KEY = queue
FORMAT = nullQueue
  • The six essential sourcetype settings: SHOULD_LINEMERGE, LINE_BREAKER, TIME_PREFIX, TIME_FORMAT, MAX_TIMESTAMP_LOOKAHEAD, TRUNCATE.
  • At index time: breaking, timestamping, SEDCMD (masking), TRANSFORMS (routing, nullQueue, index or sourcetype change). These apply where data is parsed: indexer or heavy forwarder, not the Universal Forwarder.
  • At search time: EXTRACT, REPORT, KV_MODE, FIELDALIAS, EVAL, LOOKUP, on the search head.
Watch out : Index-time settings only apply to new data: an event already indexed with a wrong date or a clear-text address will not be fixed.
Good to know : Ingest actions (UI for filtering, masking and routing to S3), Edge Processor and Ingest Processor (SPL2 pipelines) do the same work with a UI and a preview.

Commands to know #

Commands to know
  • splunk btool props list app:json --debug : show the effective configuration of a sourcetype
  • splunk add monitor /var/log/app -index web -sourcetype app:json : add a file input
  • splunk add forward-server idx1:9997 : declare an indexer on a forwarder
  • splunk list forward-server : forwarder connection status
  • splunk reload deploy-server : reload the deployment server

Sources #

Checked in November 2026 (Splunk Enterprise 10.6): check the release notes before relying on a detail, Splunk Cloud Platform evolves faster than the on-premises version.

📄 Installing Splunk and ingesting data →

My progress

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

Splunk best practices

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

Dashboards, reports and alerts in Splunk

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

Installing and administering Cribl Stream

Installing Cribl Stream with Docker or on Linux, running it as a service, understanding $CRIBL_HO...

Administering distributed Splunk

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

Security and observability with Splunk

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

Advanced SPL and knowledge objects

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

Sources, destinations and routes in Cribl Stream

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

SPL: Splunk search fundamentals

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

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!