SPLK-1002 Advanced Searching and Statistics Practice Question
A user needs a report showing the number of distinct source IPs per sourcetype over the last hour. They run: `index=* earliest=-1h | stats dc(src_ip) by sourcetype`. The search runs slowly (2 minutes) and they want to speed it up. Which optimization is most effective?
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
✓
Use `| tstats dc(src_ip) where index=* earliest=-1h by sourcetype`.
tstats reads from the tsidx files (index time summaries) which is much faster than scanning raw data. Option A uses `top` which returns top sourcetypes by count, not distinct IPs. Option B uses nested stats which still processes all raw events. Option C uses chart which also scans raw data and produces a table that does not directly give distinct IPs per sourcetype. Option D correctly uses tstats with dc(src_ip) to get distinct counts by sourcetype, leveraging accelerated data structures.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use `| top limit=100 sourcetype` to get top sourcetypes.
Why it's wrong here
This gives only top sourcetypes by count, not distinct IPs.
- ✗
Use `| stats count by sourcetype, src_ip | stats count by sourcetype`.
Why it's wrong here
First stats counts events per pair, second counts pairs, not distinct IPs.
- ✗
Use `| chart count over sourcetype by src_ip`.
Why it's wrong here
This produces a matrix, not distinct counts.
- ✓
Use `| tstats dc(src_ip) where index=* earliest=-1h by sourcetype`.
Why this is correct
tstats leverages summary data for faster retrieval.
Go deeper
Related to this question
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 →
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.