Courseiva
Advanced Searching and StatisticshardMultiple ChoiceObjective-mapped

SPLK-1002 Advanced Searching and Statistics Practice Question

A developer needs to calculate the 95th percentile of response times for each service over the past hour. The data has fields: service, response_time. Which search achieves this correctly and efficiently?

⚠ Common exam trap

Splunk often tests the distinction between `eventstats` (global aggregation appended to events) and `streamstats` (running aggregation per event), and candidates mistakenly choose `streamstats` thinking it computes a final percentile, when it actually produces a cumulative value that changes with each event.

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=main | stats perc95(response_time) by service`

`stats perc95(response_time) by service` directly calculates the 95th percentile for each service across all events in one efficient pass. It is the simplest and most efficient way. Option C, while producing the same result, is less efficient because it first appends the percentile to every event using `eventstats` and then collapses with `stats values()`, adding unnecessary overhead. Option B uses time-based bucketing and option D uses a running calculation, both of which do not produce the desired overall percentile.

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=main | stats perc95(response_time) by service`

    Why this is correct

    Correct. This search uses `stats` with a `by` clause to compute the 95th percentile for each service directly from all events in the result set. It is the most straightforward and efficient method.

  • `index=main | timechart perc95(response_time) by service`

    Why it's wrong here

    Incorrect. `timechart` creates time-based buckets and calculates perc95 for each bucket, not for the entire hour. This may produce multiple values per service across time intervals, not the overall 95th percentile.

  • `index=main | eventstats perc95(response_time) as p95 by service | stats values(p95) as p95 by service`

    Why it's wrong here

    Incorrect. This approach uses `eventstats` to compute the percentile and add it to every event, then uses `stats values(p95)` to collapse. This is unnecessary and less efficient than a simple `stats` command because it adds extra processing to assign the same value to each event.

  • `index=main | streamstats perc95(response_time) as p95 by service | stats latest(p95) as p95 by service`

    Why it's wrong here

    Incorrect. `streamstats` computes a running (cumulative) percentile that changes with each event. The `latest` value would only be the last cumulative value, which is not the true percentile over all events.

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.