Go to /opt/splunk/etc/apps/fixit/default
Create props.conf:
[network_logs]
SHOULD_LINEMERGE = true
BREAK_ONLY_BEFORE = ^\[Network-log\]:
Restart splunk /opt/splunk/bin/splunk restart
Check if the logs are correct index=main (select 5-minute window to see the latest ones)
Go to /opt/splunk/etc/apps/fixit/default
Create transforms.conf:
[network_logs_extraction]
REGEX = User named\s+(.+?)\s+from\s+(.+?)\s+department\s+accessed\s+the\s+resource\s+(.+?)/(.*?)\s+from\s+the\s+source\s+IP\s+(\d{1,3}(?:\.\d{1,3}){3})\s+and\s+country\s+(.+?)\s+at:
FORMAT = Username::$1 Department::$2 Domain::$3 Resource::$4 Source_IP::$5 Country::$6
WRITE_META = true
Update props.conf:
[network_logs]
SHOULD_LINEMERGE = true
BREAK_ONLY_BEFORE = ^\[Network-log\]:
TRANSFORM-network = network_logs_extraction
Restart splunk /opt/splunk/bin/splunk restart
Check if the logs are correct index=main (select 5-minute window to see the latest ones)
/opt/splunk/etc/apps/fixit
grep network-logs /opt/splunk/etc/apps/fixit/default/inputs.conf
/opt/splunk/etc/apps/fixit/bin/network-logsBREAK_ONLY_BEFORE
^\[Network-log\]:
Click on Domain and see the only value:
Cybertees.THM
Check the count for Username: 28
Check the count for Resource: 12
Use this query:
index=main Resource="products/*"
| stats count by Resource
2
Use this query:
index=main NOT Resource="*.*"
| top Resource
/sales/
Use this query:
index=main
| top Username
Robert Wilson
Use this query:
index=main
| rex field=Source_IP "(?<subnet>\d+\.\d+)\."
| stats count by subnet
3
Use this query:
index=main Resource="secret-document.pdf"
| top Username
Sarah Hall