Courseiva
Advanced Searching and StatisticseasyMultiple ChoiceObjective-mapped

SPLK-1002 Operator precedence Practice Question

A security analyst needs to find all events where the field 'status' is either 'error' or 'critical', and then count the number of events per source IP. Which search is correct?

⚠ Common exam trap

Splunk often tests parentheses and search-time filtering vs where. Both A and C produce correct results, but A is best practice. Do not mistake efficiency differences for correctness.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

index=security (status=error OR status=critical) | stats count by src_ip

Both A and C return events where status is error or critical. A does this at search time and is the most efficient. C uses the where command, which is valid but less efficient. B is incorrect because AND requires both statuses. D lacks parentheses and is evaluated incorrectly.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • index=security (status=error OR status=critical) | stats count by src_ip

    Why this is correct

    Correct syntax: parentheses group OR conditions, then stats count.

  • index=security status=error AND status=critical | stats count by src_ip

    Why it's wrong here

    AND requires both values in same event, which is unlikely.

  • index=security | where status=error OR status=critical | stats count by src_ip [CORRECT]

    Why this is correct

    Putting status=error OR status=critical in the base search lets Splunk filter using the indexed terms at retrieval time, pulling only matching events from the index. | where runs afterward in the pipeline, so it still requires Splunk to retrieve every event from index=security first and then discard the ones that don't match — more events read from disk for the same result.

  • index=security status=error OR status=critical | stats count by src_ip

    Why it's wrong here

    Missing parentheses, OR would be evaluated after the implicit AND before stats.

About these practice questions

One of 475 original SPLK-1002 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SPLK-1002 practice question is part of Courseiva's free Splunk certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SPLK-1002 exam.