SPLK-1002 Advanced Searching and Statistics Practice Question
Which TWO of the following searches are syntactically valid uses of the eventstats command? (Assume all referenced fields exist.)
⚠ Common exam trap
Splunk often tests the distinction between `eventstats` and `stats`, and the trap here is that candidates confuse the syntax for aliasing (missing `as`) or use invalid eval functions like `len()` instead of `mvcount()`, leading them to select options that look plausible but are syntactically incorrect.
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
✓
| eventstats sum(bytes) as total_bytes by src_ip | eval pct = bytes/total_bytes*100
The `eventstats` command calculates aggregate statistics (here, `sum(bytes)`) over the entire result set or by group (here, `by src_ip`), and it adds the result as a new field (`total_bytes`) to every event. This allows the subsequent `eval` to compute a per-event percentage using that new field. Option C is correct because `eventstats` without a `by` clause computes the aggregate over all events and adds the result (here, `avg`) to each event, enabling the `eval` to calculate the difference from the global average.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
| eventstats perc95(response_time) by host | eval p95 = perc95
Why it's wrong here
Invalid: without 'as', the resulting field is named 'perc95(response_time)', so 'perc95' is undefined.
- ✓
| eventstats sum(bytes) as total_bytes by src_ip | eval pct = bytes/total_bytes*100
Why this is correct
Valid: eventstats adds the sum per src_ip, then eval calculates percentage.
- ✓
| eventstats avg(response_time) as avg | eval diff = response_time - avg
Why this is correct
Valid: eventstats adds the global average, then eval computes the difference.
- ✗
| eventstats values(user) as users by session_id | eval num_users = len(users)
Why it's wrong here
Invalid: len() does not work on multivalue fields; use mvcount() instead.
- ✗
| eventstats max(_time)last_time by user | table last_time
Why it's wrong here
Invalid: missing 'as' between max(_time) and last_time, causing a syntax error.
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.