Incident Response splunk filters
List All Indexes
| eventcount summarize=false index=*
| stats count by index
| rest /services/data/indexes
| table titleIdentify Available Sourcetypes
| metadata type=sourcetypes
| table sourcetype, totalCount
| metadata type=sources
| table source totalCount firstTime lastTimeExplore the Fields in Your Data
| eventcount summarize=false index=*
| fields *
| stats count by sourcetype
Search for Specific Event Types (e.g., Security Logs):
index=windows sourcetype=WinEventLog:Security
| stats count by EventCode
index="botsv1" sourcetype=WinEventLog
| stats count by EventCode,source
| rename count as total_count
| sort - total_count
Check for Sysmon Logs:
index=sysmon sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
| stats count by EventCodeList Data Sources by Host:
SPL Basic Structure
Sure! Let's break down each of the commands and functions in Splunk:
1. dc(field)
dc(field)Description: Stands for "distinct count." It counts the number of unique values in a specified field.
Example:
Counts the number of unique users in the
userfield
2. sum(field)
sum(field)Description: Adds up all the values in a specified field.
Example:
Adds up all values in the
bytesfield to calculate the total
3. iplocation
iplocationDescription: Retrieves geographic information about an IP address, such as country, region, city, latitude, and longitude.
Example:
Enhances events by adding fields like
City,Region,Country, andLongitude/Latitudefor theipfield
4. dedup
4. dedupDescription: Removes duplicate events based on one or more fields, keeping only the first occurrence of each unique value.
Example:
Removes duplicate events based on the
userfield, keeping only the first event for each unique user
5. eval
5. evalDescription: Used to create or modify fields by applying expressions and functions. It's highly flexible and supports various operations, such as mathematical calculations, string manipulation, and conditionals.
Example:
Concatenates the
first_nameandlast_namefields into a new field calledfull_name
6. timechart count BY <field>
timechart count BY <field>Description: Creates a time-based chart showing the count of events, grouped by a specific field.
Example:
Produces a chart that shows the count of events over time, broken down by the
statusfield (e.g.,200,404)
7. rename
7. rename Description: The
renamecommand is used to rename fields in your search results. This is helpful when you want to use more descriptive field names or avoid conflicts when combining data from multiple sources.Example:
Renames the
client_ipfield toIP_Addressand thestatusfield toHTTP_Status
chart
Description: The chart command is used to transform the data into tables or visualizations.
Example:
index=windowslogs | chart count by User
Network Connections
Identifying Brute Force Attacks
Detecting File Uploads
LOGON activity
Detect Changes to High-Value Accounts
Privilege Escalation Detection
Monitoring Malicious File Execution
Scheduled Task
Persistence Registry Detection
PowerShell Detection
Lateral Movement & Pivot Detection
Golden Ticket Attack Detection
Kerberoasting Attack Detection
Last updated