Splunk SPL Practice: What Does This Search Return?
Unlimited Splunk SPL practice for the Core User, Power User and Advanced Power User exams. Each problem shows 12 events and one search: pick the result, or tap the events that come back. A wrong answer names the slip, such as reading != as NOT.
Event 1 is first in search order. A blank cell means the event has no such field.
Tap the events in the table.Events selected: 0
Splunk exam prep
The Core User blueprint lists dedup, sort, top, rare and stats. The Power User blueprint adds eval, where and fillnull, and the Advanced Power User blueprint adds comparison and conditional functions. Start with the free real exam questions, then get the full pack.
SPL rules FAQ
What is the difference between != and NOT in Splunk?
field!=value returns only the events that have the field with a different value. NOT field=value returns every event except the matches, and that includes events that do not have the field at all. With missing values in the data, NOT returns more events.
How do I find events that do not have a field?
Search NOT field=*. The wildcard matches any value, so NOT keeps the events where the field is missing. field=* returns the events that have the field, and field!=* never returns any events.
Does Splunk evaluate OR before AND?
The search command does: expressions in parentheses first, then NOT, then OR, then AND, and AND is implied between terms. So user=amy OR user=bob status=404 means either user, with status 404. The where and eval commands evaluate AND before OR.
Why does where host="web*" return nothing?
In where and eval a quoted string is a literal, so the test asks for a host that is exactly web*. For a wildcard, use the like function: where like(host,"web%"). The percent sign matches any number of characters and the underscore matches exactly one.
What do if() and case() return when a field is missing?
A comparison on a missing field is NULL, not TRUE. if() returns its true value only when the test is TRUE, so a missing field gets the false value. case() returns the value for the first TRUE test, and NULL when no test is TRUE, which leaves the new field empty.
What is the difference between count, count(field) and dc(field)?
count counts every event. count(field) counts the events that have that field. dc(field), or distinct_count, counts the different values of the field. With a BY clause each one is worked out for every distinct value of the BY field, one row each.
How many results do top, rare, head and sort return by default?
top and rare return 10 values, and limit=0 returns them all. head returns the first 10 results. sort returns up to 10,000 results, a number before the field sets another limit, and sort 0 returns all results.
How is the percent in top calculated?
It is the percentage of the events in the search results that have that value: the count divided by the events that reach top, times 100. If a search filters the events first, the percent is worked out on what is left.
Which event does dedup keep?
The first one in search order for each value, or for each combination of values when you list several fields. dedup 2 host keeps the first two for each host. Events that do not have the field are dropped unless you add keepempty=true.
Where do events with a missing field go when I sort?
Last, in both directions. Splunk treats a missing value as the highest possible value in ascending order and as the lowest in descending order. So sort -bytes followed by head never keeps an event with no bytes ahead of one that has a value.
What does fillnull put in an empty field?
The value 0, unless you give another one with value=. With a field list only those fields are filled. With no field list the value goes into every field.
Which Splunk exams does this drill cover?
The Core User blueprint (SPLK-1001) lists dedup, sort, top, rare and stats. The Power User blueprint (SPLK-1002) lists eval, filtering with search and where, and fillnull. The Advanced Power User blueprint (SPLK-1004) lists comparison and conditional functions, and SPL and Efficient Searching is 20% of the Cybersecurity Defense Analyst exam (SPLK-5001).
Sources
- Splunk Enterprise 10.6 Search Manual, Difference between != and NOT and Wildcards: != returns only events that have a value in the field, NOT also returns events without one; the asterisk in search, the percent sign and underscore in like.
- Splunk Enterprise 10.6 Search Reference, search: AND is implied between terms; the order NOT, OR, AND; NOT field=* and field!=*.
- Search Reference, where, eval and Comparison and Conditional functions: where returns only results where the expression is true; quoted strings are literals; wildcards only with like; if, case and NULL.
- Search Reference, stats and Aggregate functions: one row with no BY clause, one row for each distinct BY value or combination; count, count(field) and distinct_count.
- Search Reference, top and rare: default limit 10, limit=0, and the count and percent fields.
- Search Reference, dedup, sort, head and fillnull: the first event is kept and keepempty is false by default; the plus and minus signs, the default limit of 10000 and missing values in sort; head returns the first 10 results; fillnull fills with 0 by default.
- Splunk exam blueprints: Core Certified User, Core Certified Power User, Core Certified Advanced Power User and Certified Cybersecurity Defense Analyst.
- Checked 20 November 2026. The tool's own approach: events and searches are invented, and the drill shows percent to 2 decimal places (Splunk shows more). It never asks about things these pages do not state, such as the row order when two counts tie or a missing value in a BY field. An independent re-solver, written from the quoted rules, agreed with the drill on 21,000 generated problems.
Checked 20 November 2026 against the Splunk Enterprise 10.6 Search Reference and Search Manual and the Splunk exam blueprints.
- DrillSplunk storage sizing practiceWork out indexer cluster storage from GB per day, retention, replication and search factor, per peer and without a cluster.
- DrillSplunk config precedence practicePick the .conf copy or props.conf stanza whose value Splunk uses, global vs app/user context.
- DrillKubernetes scheduling and NetworkPolicy practiceSay where a Pod can be scheduled, its QoS class and which traffic a NetworkPolicy allows.