Courseiva
Basic Searching and Transforming CommandsmediumMultiple ChoiceObjective-mapped

SPLK-1001 Basic Searching and Transforming Commands Practice Question

Exhibit

index=network sourcetype=cisco:asa
 | eval src_zone=case(src_ip="10.0.0.0/8","internal", 1=1,"external")
 | search src_zone=internal
 | stats count by src_zone

Refer to the exhibit. The search returns only events where src_zone is 'external'. What is the problem?

⚠ Common exam trap

Splunk often tests the misconception that the `case` function can handle any comparison operator, including CIDR matching, when in fact it requires explicit use of `cidrmatch` for IP subnet evaluation.

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

The 'case' function cannot compare IP addresses to CIDR ranges

The `case` function in SPL cannot compare IP addresses to CIDR ranges directly because it expects boolean expressions, not IP-matching operators. The correct approach is to use the `cidrmatch` function within the `case` function to evaluate whether `src_ip` falls within a given CIDR range. Without `cidrmatch`, the comparison `src_ip='10.0.0.0/8'` is treated as a string equality check, which will never match an IP address to a CIDR notation string.

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 'src_ip' field is not extracted

    Why it's wrong here

    It is extracted.

  • The default condition should be 'true()' instead of '1=1'

    Why it's wrong here

    1=1 works as true, but the issue is CIDR.

  • The 'case' function cannot compare IP addresses to CIDR ranges

    Why this is correct

    Correct: case uses exact string comparison, not subnet matching.

  • The 'search' command should be before 'eval'

    Why it's wrong here

    Order is fine.

Visual reference

192.168.1.0 /24 256 addresses (254 usable) 192.168.1.0 /25 Subnet A 128 addr (126 usable) 192.168.1.128 /25 Subnet B 128 addr (126 usable) Borrowing 1 bit from host portion creates 2 subnets (/25)

About these practice questions

Courseiva writes every SPLK-1001 question from scratch — 502 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-1001 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-1001 exam.