Splunk#
Splunk is a platform to search, analyze, and visualize machine-generated data from websites, applications, sensors, and devices. The operator uses SPL to extract fields, group events, and build detections.
Fields#
Extract data from events into fields so reports can run on it meaningfully.
SPL |
Effect |
|---|---|
|
Extract field / value pairs and reload extraction settings from disk. |
|
Extract field / value pairs delimited by |
|
Extract the |
|
Automatically extract fields from XML-formatted data. |
|
Extract |
|
Add |
|
Add |
|
Add location info for the first 20 events with 404 from webserver1. |
Convert#
Change names, units, types, or attributes of fields.
SPL |
Effect |
|---|---|
|
Convert every field to a number except |
|
Convert memory values in |
|
Convert |
|
Strip unit text from |
|
Rename |
|
Normalize |
Filter#
Filter and re-arrange how Splunk displays fields.
SPL |
Effect |
|---|---|
|
Keep only the |
|
Keep only |
|
Remove |
|
Keep results with matching src or dst values. |
|
Keep results whose |
|
Remove duplicates with the same |
|
Extract a pattern and store as a new field. |
|
Use a regex against raw results. |
Order#
SPL |
Effect |
|---|---|
|
Sort by |
|
Reverse the order of a result set. |
|
Return the first 20 results. |
|
Return the last 20 results in reverse order. |
|
First 1000 lines of log file, order top 50. |
Group#
SPL |
Effect |
|---|---|
|
Group results with same |
|
Group results sharing same value of |
|
Group results into 4 clusters by |
|
Cluster events, sort by |
Classify#
SPL |
Effect |
|---|---|
|
Force Splunk to apply event types you have configured. |
|
Auto-discover and apply event types to events containing |
Display#
Generate results from data using commands other than search.
You must use a pipe (|) before any data-generating command that
is not the search command.
SPL |
Effect |
|---|---|
|
Read CSV results, keep error-containing rows, write to CSV. |
|
Display events from a file as if indexed. |
|
Run saved search and email results. |
Report#
Summarize results, perform stats, graph.
SPL |
Effect |
|---|---|
|
Return least common values of |
|
Return 20 most common |
|
Total count of unique |
|
Average for each hour of any field ending in |
|
Search access logs, sum hits from top 100 |
|
Associate results with each other (at least 3 references). |
|
Average size per distinct |
|
Maximum delay by size, max 10 buckets. |
|
Graph average thruput of hosts over time. |
|
Timechart of avg |
|
Average CPU per minute per host. |
|
Timechart of count by host, null filled. |
|
Contingency table. |
|
Co-occurrence correlation between all fields. |
|
Sum numeric fields per result into |
|
Return events with uncommon values. |
|
Bucket results into 10 bins, count raw events. |
|
Average thruput per host per 5-minute span. |
|
Sum and divide by 1000. |
|
p10 and p90 of raw log length per sourcetype. |
Admin#
SPL |
Effect |
|---|---|
|
Crawl roots and add discovered inputs to |
|
View processing properties in |
|
View audit trail; check for tampering. |
|
List all indices. |
|
List indices with sizes in MB. |
Subsearch#
SPL |
Effect |
|---|---|
|
URLs that contain |
|
Find events around |
|
Build a search string from |
Email#
Append sendemail to mail any query results.
... | sendemail to="john@example.com"