Courseiva
Advanced Searching and StatisticsmediumMultiple ChoiceObjective-mapped

SPLK-1002 Advanced Searching and Statistics Practice Question

You need to find the percentage of total events contributed by each sourcetype. Which command should follow index=* | stats count by sourcetype?

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(count) as total | eval percent = count/total*100

`eventstats sum(count) as total` adds a new field 'total' containing the sum of the count field across all events, and then `eval percent = count/total*100` computes the percentage for each sourcetype. Option A (`addtotals`) adds row totals, not a column total, so it cannot be used to compute percentages of total. Option C uses `sum(count)` inside `eval`, which is a statistical function not available in `eval`. Option D (`appendpipe`) appends a row with the total, not a column, making the calculation incorrect because the total is not available per event in the subsequent `eval`.

Answer analysis

Option-by-option breakdown

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

  • addtotals

    Why it's wrong here

    addtotals adds row totals, not column totals.

  • eventstats sum(count) as total | eval percent = count/total*100

    Why this is correct

    eventstats adds total column, then eval computes percentage per row.

  • eval percent = count / sum(count) * 100

    Why it's wrong here

    sum(count) is an aggregation and cannot be used in eval without a prior stats.

  • appendpipe [stats sum(count) as total] | eval percent = count/total*100

    Why it's wrong here

    appendpipe adds a new row with the total, not a column, so the eval will divide count by total only for that row.

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.