Courseiva
Advanced Searching and StatisticseasyMultiple ChoiceObjective-mapped

SPLK-1002 Advanced Searching and Statistics Practice Question

Exhibit

index=web | eval status_category=case(status>=500, "Server Error", status>=400, "Client Error", 1=1, "Other") | stats count by status_category

Refer to the exhibit. What is the purpose of the eval command in this search?

⚠ Common exam trap

Splunk often tests the distinction between creating a new field versus modifying an existing field, and candidates mistakenly think eval replaces the original field when it actually adds a new one.

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

It creates a new field 'status_category' based on the numeric status code, grouping into three categories.

The eval command creates a new field 'status_category' by evaluating a CASE expression that maps numeric HTTP status codes (e.g., 200, 404, 500) into three descriptive categories: 'OK', 'Client Error', and 'Server Error'. This is a common pattern for enriching raw data with human-readable labels without altering the original 'status' field. The correct answer is D because the search explicitly defines the new field based on the status code values.

Answer analysis

Option-by-option breakdown

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

  • It replaces the status field with the category.

    Why it's wrong here

    Original status field persists

  • It adds a temporary field that is not retained after stats.

    Why it's wrong here

    Field is retained as part of stats output

  • It converts the status field to a string.

    Why it's wrong here

    Eval does not convert the original field

  • It creates a new field 'status_category' based on the numeric status code, grouping into three categories.

    Why this is correct

    Correctly describes the eval case usage

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.