SPLK-1001 practice question 20 of 30

Which of the following is the appropriately formatted SPL search?

Full set: 244 questions

Domain Search Language Fundamentals

Answer options
A: index=security sourcetype=linux secure (invalid OR failed) | stats count as "Potential Issues" Correct answer
B: index=security sourcetype=linux secure (invalid OR failed) | stats as "Potential Issues"
C: index—security sourcetype=linux secure (invalid OR failed) | count stats as "Potential Issues"
D: index—security sourcetype=linux secure (invalid OR failed) | count as "Potential Issues"
Correct Answer:
A. index=security sourcetype=linux secure (invalid OR failed) | stats count as "Potential Issues"
Explanation

Option A follows proper SPL syntax: search terms (index=security sourcetype=linux secure (invalid OR failed)) are separated from the transforming command with “|”. The stats command is spelled correctly and uses the aggregate function count with the optional AS clause to rename the result field (“Potential Issues”). This construction exactly matches Splunk’s documented examples for counting events and renaming the output field.

Why Incorrect

B. Omits an aggregate function; “stats as” without count, sum, etc. is syntactically invalid.
C. Uses em-dash instead of “=” and misorders keywords (“count stats”), violating SPL grammar.
D. Uses em-dash, and “count” alone is not a Splunk command; must be used within stats.

References

1. Splunk® Search Reference 9.0, “stats” command – Syntax and example: “...| stats count AS total” (Section: stats, para 2).

2. Splunk® Enterprise Search Manual 9.0, “About basic searches” – requirement for ‘|’ to introduce transforming commands (Ch. 3, p. 49).

3. Splunk Fundamentals 1 Courseware, Module 7 “Transforming Data with stats” – slide 5: “stats count AS ”.

Scroll to Top