SPLK-1002 Advanced Searching and Statistics Practice Question
A user wants to create a timechart showing the number of distinct users per hour over the past week. Which search is correct?
⚠ Common exam trap
Splunk often tests the distinction between `stats` and `timechart` — the trap here is that candidates mistakenly use `stats ... by _time` (Option A) thinking it produces a timechart, or misuse the `by` clause in `timechart` (Option C) by including `_time` as a split-by field, which breaks the time-based grouping.
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 | timechart dc(user) span=1h
The `timechart` command automatically creates a time-based chart with a default or specified `span`, and `dc(user)` calculates the distinct count of users per time bucket. The `span=1h` argument sets the bucket size to one hour, and the `by` clause is not needed because `timechart` implicitly groups by `_time`. This produces the desired output of distinct users per hour over the past week.
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 | bucket _time span=1h | stats dc(user) by _time
Why it's wrong here
Produces a table, not a timechart.
- ✓
index=web | timechart dc(user) span=1h
Why this is correct
Correctly uses timechart with distinct count function.
- ✗
index=web | timechart dc(user) by _time span=1h
Why it's wrong here
The 'by _time' clause is unnecessary and may cause issues.
- ✗
index=web | timechart count by user span=1h
Why it's wrong here
Shows count per user, not distinct users.
Go deeper
Related to this question
About these practice questions
This SPLK-1002 question is part of Courseiva's 475-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.