|): Separate commands and pass the output of one command to the next.Example:
index=main error | stats count by host | sort -count
Explanation:
index=main error: Retrieve all events containing the word "error" from the main index.stats count by host: Group results by host and count the number of events for each host.sort -count: Sort the results in descending order of the count.=: Equal to.!=: Not equal to.<: Less than.>: Greater than.<=: Less than or equal to.>=: Greater than or equal to.Example:
status_code>=400
status_code is greater than or equal to 400 (indicating errors in HTTP responses).AND: Both conditions must be true.OR: At least one condition must be true.NOT: Exclude events matching a condition.Example:
error AND (critical OR high)
*: Matches zero or more characters.Example:
error_code=5*
error_code that starts with "5" (e.g., 500, 501, 503).SPL includes a rich set of statistical functions to analyze and summarize data. Below are the most common ones:
countCounts the number of events.
Example:
index=main | stats count
main index.avgCalculates the average of a numeric field.
Example:
index=main | stats avg(response_time)
response_time across all events.sumComputes the total sum of a numeric field.
Example:
index=main | stats sum(bytes)
Multiple functions can be used in a single query.
Example:
index=main | stats count, avg(response_time), sum(bytes) by host
host and calculates:count: Number of events.avg(response_time): Average response time.sum(bytes): Total bytes.sort command to order search results based on a specific field.sort +fieldname.sort -fieldname.Example:
index=main | stats avg(response_time) by host | sort -avg(response_time)
host, calculates the average response_time, and sorts the results in descending order of the average response time.Use the table command to display results in a tabular format.
Syntax:
table field1, field2, ...
Example:
index=main | table host, response_time
host and response_time fields in a table.sort and tableThese commands are often used together for better presentation.
Example:
index=main | stats count by host | sort -count | table host, count
host, counts them, sorts by count in descending order, and displays the results in a table.Let’s create a complete query example:
index=web_logs status_code>=400 | stats count by host | sort -count | table host, count
Explanation:
web_logs index where the status_code is 400 or higher.host and count the number of events for each host.count in descending order.host and count.In Splunk SPL, Boolean expressions often involve multiple AND, OR, and NOT operators. Without proper grouping, the logic may be interpreted incorrectly.
Parentheses are used to group conditions and explicitly control the order in which they are evaluated.
This prevents ambiguity and ensures that the search behaves as intended.
error AND (status=500 OR status=503)
This query returns events that:
Contain the word "error", and
Have a status of either 500 or 503
error AND status=500 OR status=503
This might be interpreted as:
Events that contain "error" and status=500 OR
Events that simply have status=503, even if they don’t contain "error"
If a question tests how SPL evaluates logical operators, always check for parentheses to determine grouping.
Splunk allows the use of the * wildcard in field value comparisons, but not in raw keyword searches.
sourcetype=*access*
access.*error*
This is not valid SPL syntax in raw text searches.
Wildcards must be paired with a field.
You may see a multiple-choice question that asks:
“Which of the following SPL queries uses wildcards correctly?”
values() and dc()In addition to basic functions like count, avg, and sum, you must know two key statistical functions often tested in SPLK-1001:
values(field)Returns a list of unique values for the specified field.
Great for summarizing data categories per group.
Example:
index=main | stats values(status_code) by host
status_code values for each host.dc(field)Short for distinct count.
Returns the number of unique values for a field.
Example:
index=main | stats dc(user)
table Command Does Not Sort Resultstable:The table command formats search results into a column-based table.
It does not apply any sorting logic.
sort command before table.Example:
index=main | stats count by host | sort -count | table host, count
A question might ask:
“Which command is required to order the results shown by a table?”
Correct answer: sort.
Every SPL query must start with a single primary search clause, usually:
index=...
After the initial search, you can chain transformation commands using pipes (|), such as:
stats, sort, table, eval, fields, etc.index=web_logs | index=error_logs
OR):(index=web_logs OR index=error_logs)
| Concept | Details |
|---|---|
| Parentheses for logical grouping | Control Boolean operator evaluation (e.g., AND, OR) |
| Wildcard usage | Allowed only in field values, not in raw keyword searches |
values(field) function |
Returns a list of unique values per group |
dc(field) function |
Returns a count of unique values |
table command |
Formats results; does not sort |
| Query structure rule | Only one initial search clause allowed in SPL queries |
What does the pipe (|) symbol represent in a Splunk search?
The pipe sends the results of one command as input to the next command in the search pipeline.
Splunk processes searches using a pipeline model. The initial search retrieves events, and each subsequent command modifies or analyzes the results. For example:
index=web | stats count by status
The first part retrieves events from the web index, and the stats command aggregates the results. Understanding the pipeline is fundamental because command order affects results. The SPLK-1001 exam frequently tests knowledge of the search pipeline.
Demand Score: 88
Exam Relevance Score: 95
What does the table command do in Splunk?
The table command displays selected fields in a table format.
The table command organizes results by listing specific fields as columns. Example:
index=web | table host status uri
This creates a structured table containing only the chosen fields. Unlike fields, which only filters fields internally, table also formats the output visually. This distinction is commonly tested in the certification exam.
Demand Score: 80
Exam Relevance Score: 92
What does the rename command do in a Splunk search?
The rename command changes the name of a field in search results.
The rename command is useful when preparing data for reports or dashboards. Example:
... | rename status AS HTTP_Status
This changes the field name from status to HTTP_Status in the results table. The underlying data is not changed—only the displayed field name. The SPLK-1001 exam tests understanding of how search commands modify result presentation.
Demand Score: 76
Exam Relevance Score: 89
What does the dedup command do in Splunk?
The dedup command removes duplicate events based on specified fields.
For example:
... | dedup user
This keeps only the first occurrence of each unique user value and removes the rest. It is commonly used to find unique events or eliminate repeated log entries. The certification exam often includes scenarios where duplicate results must be removed.
Demand Score: 82
Exam Relevance Score: 93
What does the sort command do in Splunk?
The sort command orders search results based on specified fields.
Example:
... | sort -count
This sorts results in descending order by the count field. Sorting helps analysts identify trends, top values, or anomalies in the data. Understanding sorting syntax is part of the search language fundamentals domain.
Demand Score: 77
Exam Relevance Score: 90
Why is command order important in the Splunk search pipeline?
Because each command processes the results produced by the previous command.
If commands are placed in the wrong order, the search may return incorrect results or fail entirely. For example, running stats early removes raw events, which means later commands that rely on event data may not work. The exam frequently tests whether candidates understand that search commands operate sequentially in a pipeline.
Demand Score: 85
Exam Relevance Score: 96