SPLK-1001 Basic Searching and Transforming Commands Practice Question
A search returns events with a field 'ip' that contains both IPv4 and IPv6 addresses. An analyst wants to count events for each IP type (IPv4 vs IPv6). Which command should be used to create a new field that categorizes the IP type?
⚠ Common exam trap
Test-takers frequently confuse `rex` with `eval` because both can manipulate fields, but `rex` only extracts existing patterns into new fields, whereas `eval` can create fields based on conditional logic or calculations.
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
✓
eval
The `eval` command can create a new field by evaluating an expression, such as using the `if` function with `like()` or `match()` to test whether the IP address contains a colon (IPv6) or a dot (IPv4). This allows the analyst to categorize each event's IP type into a new field like `ip_type` without altering the original data.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
fields
Why it's wrong here
fields selects existing fields.
- ✗
convert
Why it's wrong here
convert changes data types, not categorizes.
- ✓
eval
Why this is correct
eval can create a new field with conditional logic.
- ✗
rex
Why it's wrong here
rex extracts fields from raw text, does not categorize.
Go deeper
Related to this question
About these practice questions
One of 502 original SPLK-1001 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 →
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.