nerdexam
Splunk

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)
  • A
    4% (1)
  • B
    81% (21)
  • C
    8% (2)
  • D
    8% (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 stats command itself (stats | count by price), breaking the command syntax - stats count by price must remain a single, unbroken command.
  • C splits stats from count by price with a pipe, which is invalid; stats count by price is 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.

Full SPLK-1001 Practice