Splunk
π§ Tool Note β Category: SIEM Platform | Commercial (Free tier available)
π Quick Overview
What is it? A Security Information and Event Management (SIEM) platform that collects, indexes, searches, and visualises machine-generated data (logs).
Official Website: https://www.splunk.com/ License: Splunk Free (500MB/day) / Enterprise (paid) Used in: CSF & NS, DFIR
π― What Problem Does It Solve?
- Centralise logs from hundreds of sources into one searchable platform
- Correlate events across devices (firewall + server + endpoint)
- Detect security incidents through automated alerting
- Create dashboards for SOC monitoring
- Search and analyse historical log data
βοΈ How It Works
Splunkβs job is schema-on-read: it ingests raw logs as-is, then applies structure at search time. Three roles (all in one process for Splunk Free, split across servers in Enterprise):
Data sources (Windows evtx, syslog, firewall, app logs)
β (Universal Forwarder ships the data)
βΌ
[ Forwarder ] β [ Indexer ] β [ Search Head ]
stores + runs SPL,
indexes dashboards, alerts
- Forwarder β a lightweight agent on each endpoint that streams logs to the indexer. (In the lab you often just upload a file directly instead.)
- Indexer β the engine. At index time it breaks the stream into events (usually one per line), stamps each with a timestamp, tags a sourcetype (e.g.
WinEventLog:Security), and builds indexes so searches are fast. Data lands in an index (defaultmain). - Search Head β where you run SPL. At search time Splunk extracts fields (like
EventCode,src_ip) from the raw event on demand β so you can pull out new fields later without re-ingesting.
Index-time vs search-time is the key idea: heavy structure isnβt fixed on ingest (thatβs what makes Splunk flexible with messy logs) β fields are teased out when you search.
SPL is a pipeline
Like Unix pipes, each | passes results to the next command:
index=main sourcetype=WinEventLog:Security EventCode=4625 β search (get events)
| stats count by src_ip β transform (aggregate)
| sort -count β order
search β transform (stats/timechart/top) β format (sort/table). Master stats, timechart, and top and you can build most SOC detections.
π Key Features
- SPL (Search Processing Language) for powerful queries
- Real-time alerting and correlation rules
- Dashboard creation with charts and tables
- Data ingestion from files, syslog, APIs
- Source type auto-detection
- Saved searches and scheduled reports
π» Installation
- Download Splunk Free from splunk.com
- Install on Linux/Windows
- Access at
http://localhost:8000 - Default credentials: set during install
π Basic SPL
# Search all events
index=main
# Filter by event code
index=main EventCode=4625
# Count failures by IP
index=main EventCode=4625 | stats count by src_ip | sort -count
# Timeline chart
index=main EventCode=4625 | timechart countπ¬ Typical Workflow (Practical 5 β brute-force triage)
# 1. Failed logons over time β spot the spike
index=main sourcetype=WinEventLog:Security EventCode=4625 | timechart count
# 2. Which source IPs are hammering us
index=main EventCode=4625 | stats count by src_ip | sort -count
# 3. Did any brute-force succeed? (4624 = successful logon)
index=main EventCode=4624 src_ip=<attacker_ip>
# 4. Did they create an account (4720) or install a service (7045)? β persistence
index=main (EventCode=4720 OR EventCode=7045)Pattern: many 4625 from one IP β a 4624 from that IP β 4720/7045 = brute-force that succeeded and established persistence. See Windows Event IDs Reference and SOC Operations & Incident Lifecycle.
β οΈ Gotchas / Limitations
- Splunk Free = 500 MB/day ingest, and has no authentication, no alerting, no distributed search β fine for labs, not production.
- Timestamps matter β if Splunk parses the wrong time field, events sort wrongly; check the
_timecolumn. - Field names depend on sourcetype (
src_ipvsSource_Network_Address) β inspect the event first (| table _raw) before writingstats by. - Search-time field extraction means a bad search returns nothing rather than an error β verify with a broad search first, then narrow.