Courseiva
Advanced Searching and StatisticseasyMultiple ChoiceObjective-mapped

SPLK-1002 Advanced Searching and Statistics Practice Question

An analyst wants to calculate the average response time for each web server, but only for requests that returned status code 200. Which search accomplishes this?

⚠ Common exam trap

Splunk often tests the order of operations in Splunk searches, specifically that filtering (with `where` or search terms) must occur before aggregation (`stats`) to affect the computed values, and that `eval` cannot perform aggregate functions like `avg()`.

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 sourcetype=access status=200 | stats avg(response_time) by host

It first filters events with `status=200` (only successful requests), then uses `stats avg(response_time) by host` to compute the average response time per web server. This ensures the aggregation is performed only on the relevant subset of data, matching the requirement precisely.

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 sourcetype=access status=200 | sort host | stats avg(response_time)

    Why it's wrong here

    `sort` is unnecessary and `stats` without `by` gives overall average.

  • index=web sourcetype=access | eval avg_time=avg(response_time) by host | where status=200

    Why it's wrong here

    `eval` cannot perform aggregation.

  • index=web sourcetype=access status=200 | stats avg(response_time) by host

    Why this is correct

    Correct order: filter, then stats.

  • index=web sourcetype=access | stats avg(response_time) by host | search status=200

    Why it's wrong here

    Averages all requests, not just status=200.

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 →

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.