SplunkSPLThreat HuntingDashboard

Splunk — SPL Mastery

Basic → advanced SPL, threat hunting, dashboards, alerts. Ini yang bikin dapet kerja.

15 min read2026-04-07

1. 01 — SPL Basics

text
index=* earliest=-24h
index=windows EventCode=4625 | stats count by user, src_ip
index=web_logs | top limit=10 src_ip
index=* | timechart count span=1h
index=* src_ip="192.168.1.100" | table _time, sourcetype, EventCode, user

2. 02 — Threat Hunting

text
index=windows EventCode=4625
| bucket _time span=5m
| stats count by _time, src_ip, user
| where count > 5

index=windows EventCode=4688 CommandLine="*-enc*" OR CommandLine="*-EncodedCommand*"

index=network bytes_out > 10000000
| stats sum(bytes_out) as total_MB by src_ip, dest_ip
| eval total_MB=round(total_MB/1024/1024,1)
| sort -total_MB

3. 03 — Advanced SPL

text
# eval
index=network | eval MB = bytes_out/1024/1024 | where MB > 100

# rex
index=web_logs | rex field=_raw "user=(?<username>\w+)" | stats count by username

# transaction
index=windows EventCode=4624 OR EventCode=4634
| transaction user maxspan=1h
| eval duration=round(duration/60,1)
| table user, duration, eventcount

# lookup
index=firewall action=blocked
| lookup threat_intel.csv ip AS src_ip OUTPUT threat_name, severity
| where isnotnull(threat_name)

# tstats
| tstats count where index=windows by _time, host span=1h

4. Interview Tip

Hafalkan: stats, eval, rex, transaction, lookup, timechart. Ini yang paling sering ditanya.


5. 04 — Dashboards

Buat dashboard untuk monitoring real-time.


6. Dashboard Panels

  • Failed Logins

    index=windows EventCode=4625 | timechart count span=1h

  • Top Attackers

    index=windows EventCode=4625 | top limit=10 src_ip

  • New Services

    index=windows EventCode=7045 | table _time, host, ServiceName

  • PowerShell Activity

    index=windows EventCode=4104 | stats count by host | sort -count


7. 05 — Alerts

Save As → Alert. Config: trigger condition, schedule (5-15min), action (email/webhook), throttle.

Jangan real-time alert untuk heavy queries. Pakai scheduled alert dengan interval 5-15 menit.


8. 06 — BOTS Challenge

BOTS

Boss of the SOC — CTF challenge terbaik untuk practice SPL

Visit

Training

Free courses dari Splunk Education

Visit