Analyst Cheatsheets

Splunk

Hunting & Correlation

Count events by Source IP

index=* | stats count by src_ip | sort - count

Find rare failed logins

index=auth action=failure | rare dest_user

Extract IP using Regex

index=* | rex field=_raw "(?<extracted_ip>\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})"

Correlate parent and child processes

index=windows sourcetype=WinEventLog:Security EventCode=4688 | transaction parent_process_id child_process_id

Identify brute force attempts (time window)

index=auth action=failure | bucket _time span=5m | stats count by src_ip, _time | where count > 10

Identify anomalous daily spikes using streamstats

index=web | timechart count | streamstats avg(count) as average stdev(count) as standard_deviation | eval spike=if(count > average+(2*standard_deviation), 1, 0)

System & Index Troubleshooting

View internal Splunk errors

index=_internal log_level=ERROR OR log_level=FATAL | stats count by component, host

List indexes and sourcetypes

| metasearch index=* sourcetype=* | stats values(sourcetype) as sourcetype count by index

Check daily license usage

index=_internal source=*license_usage.log | timechart span=1d sum(b) as bytes | eval GB = round(bytes/1024/1024/1024, 2)

Search across all indexes fast (metadata)

| tstats count where index=* by index, sourcetype