Courseiva
Advanced Searching and StatisticsmediumMultiple ChoiceObjective-mapped

SPLK-1002 Advanced Searching and Statistics Practice Question

Exhibit

Refer to the exhibit.

`index=web sourcetype=access | eval category=case(status<300, "success", status<400, "redirect", status<500, "client_error", status<600, "server_error") | stats count by category | sort - count`

The exhibit shows a search that categorizes HTTP status codes and counts them. If the search returns only three categories, what is the most likely reason?

⚠ Common exam trap

Splunk often tests the default behavior of `stats` to omit zero-count groups, leading candidates to incorrectly assume that the `case` function is incomplete or that events are being filtered out, rather than recognizing that empty categories are simply not displayed.

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

Some categories have zero events and are not displayed by default.

The `stats` command in Splunk, by default, only returns results for categories that have at least one event. If a category (e.g., a specific HTTP status code range) has zero matching events, it will not appear in the output. This is a common behavior in aggregation commands, where null or zero-count results are suppressed unless explicitly requested with the `usenull=f` or `fillnull` options.

Answer analysis

Option-by-option breakdown

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

  • The stats command is filtering out events with null category.

    Why it's wrong here

    All events get a category from case.

  • The case function has a syntax error that truncates results.

    Why it's wrong here

    The syntax is correct.

  • The case statement does not cover status codes above 599.

    Why it's wrong here

    600 is not used, but status codes rarely exceed 599.

  • Some categories have zero events and are not displayed by default.

    Why this is correct

    stats count by category only shows categories with non-zero counts unless usenull is specified.

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.