SPLK-1001 · Question #214
Select the answer that displays the accurate placing of the pipe in the following search string: index=security sourcetype=access_* status=200 stats count by price
The correct answer is B. index=security sourcetype=access_* status=200 | stats count by price. Option B is correct because in Splunk SPL, the pipe | separates the search/filter portion from the reporting command. Here, index=security sourcetype=access_ status=200 is the search that retrieves filtered events, and stats count by price is the reporting command that…
Question
Select the answer that displays the accurate placing of the pipe in the following search string:
index=security sourcetype=access_* status=200 stats count by price
Options
- Aindex=security sourcetype=access_* status=200 stats | count by price
- Bindex=security sourcetype=access_* status=200 | stats count by price
- Cindex=security sourcetype=access_* status=200 | stats count | by price
- Dindex=security sourcetype=access_* | status=200 | stats count by price
How the community answered
(26 responses)- A4% (1)
- B81% (21)
- C8% (2)
- D8% (2)
Explanation
Option B is correct because in Splunk SPL, the pipe | separates the search/filter portion from the reporting command. Here, index=security sourcetype=access_* status=200 is the search that retrieves filtered events, and stats count by price is the reporting command that aggregates them - so the pipe belongs between these two logical parts.
Why the distractors fail:
- A places the pipe inside the
statscommand itself (stats | count by price), breaking the command syntax -stats count by pricemust remain a single, unbroken command. - C splits
statsfromcount by pricewith a pipe, which is invalid;stats count by priceis one complete command and cannot be fragmented. - D inserts a pipe before
status=200, splitting the search filters - all filter conditions belong together before the first pipe, not broken apart.
Memory tip: Think of the pipe as a "hand-off" - first you find your events (all the field=value filters), then you hand them off via | to a command that transforms them. If you're still filtering, no pipe yet; the pipe only appears when you're done filtering and ready to process.
Community Discussion
No community discussion yet for this question.