Courseiva
Advanced Searching and StatisticshardMultiple ChoiceObjective-mapped

SPLK-1002 Advanced Searching and Statistics Practice Question

A search returns events with fields 'user', 'duration', and 'status'. The analyst wants to find users whose average duration exceeds 100 and who have more than 5 events. Which search is correct?

⚠ Common exam trap

Splunk often tests the difference between `stats` and `eventstats`, where candidates mistakenly choose `eventstats` thinking it filters users, but it actually keeps all events and applies the `where` condition per event, not per user.

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

`... | stats avg(duration) as avg_dur, count as cnt by user | where avg_dur>100 and cnt>5`

It uses the `stats` command to compute the average duration and count per user in a single pass, then filters with `where` to enforce both conditions: average duration > 100 and event count > 5. This is the standard pattern for per-user aggregation followed by post-aggregation filtering in Splunk.

Answer analysis

Option-by-option breakdown

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

  • `... | where avg(duration)>100 | stats count by user | where count>5`

    Why it's wrong here

    The first where tries to use an aggregate function on raw events, which is invalid.

  • `... | top user limit=0 | where avg(duration)>100`

    Why it's wrong here

    Top counts events per user, does not compute average.

  • `... | stats avg(duration) as avg_dur, count as cnt by user | where avg_dur>100 and cnt>5`

    Why this is correct

    Correct: stats reduces to one row per user, then where filters.

  • `... | eventstats avg(duration) as avg_dur, count as cnt by user | where avg_dur>100 and cnt>5`

    Why it's wrong here

    eventstats adds fields to each event, does not collapse; the search would return events, not distinct users.

  • `... | stats avg(duration) as avg_dur, count as cnt by user | having avg_dur>100 and cnt>5`

    Why it's wrong here

    'having' is not a valid Splunk command.

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 →

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.