SPLK-1002 Advanced Searching and Statistics Practice Question
An analyst wants to identify the top 5 user agents that generated the most 404 errors in the last 24 hours. Which search accomplishes this correctly and efficiently?
⚠ Common exam trap
Splunk often tests the order of operations in Splunk SPL, specifically that filtering commands like `status=404` must precede statistical commands like `top` or `stats` to ensure the aggregation is performed only on the subset of interest, not on the entire dataset.
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=web status=404 | top limit=5 user_agent
It first filters events to only those with status=404, then uses the `top` command with `limit=5` to efficiently count and rank user_agent values. This ensures the search only processes relevant events, minimizing resource usage and returning the correct top 5 user agents for 404 errors.
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=web status=404 | top limit=5 user_agent
Why this is correct
Correctly filters for 404 errors and efficiently returns top 5 user agents using the top command.
- ✗
index=web | top limit=5 user_agent status=404
Why it's wrong here
Invalid syntax: top command does not accept a filter condition.
- ✗
index=web | top limit=5 user_agent
Why it's wrong here
Missing filter for status=404; returns top 5 overall user agents.
- ✗
index=web | stats count by user_agent | where status=404 | top 5 user_agent
Why it's wrong here
The status field is lost after stats, so the where clause fails.
Go deeper
Related to this question
About these practice questions
Courseiva writes every SPLK-1002 question from scratch — 475 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.