SPLK-1002 Macros, Saved Searches and CIM Practice Question
Exhibit
macro definition: eval $field$ = if(isnull($field$), "" , $field$)
Refer to the exhibit. A search uses the macro as `| `fillnull(field=user)`. However, the search fails with a syntax error. What is the most likely issue?
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 macro definition contains unescaped commas
In macro definitions, commas that are part of the code need to be escaped with a backslash because commas are used to separate macro arguments. The `if` function in the macro definition uses commas, and they are not escaped, so the macro expansion is broken. Option A is incorrect; the invocation with `field=` is a valid way to pass named arguments. Option C is incorrect; named arguments are allowed and not the issue. Option D is incorrect; a leading pipe is not needed inside the macro definition because the invocation already provides a pipe before the macro name.
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 macro argument should be passed without the `field=` prefix
Why it's wrong here
Incorrect: Named arguments require the prefix.
- ✓
The macro definition contains unescaped commas
Why this is correct
Correct: Commas in the `if` function must be escaped.
- ✗
The macro definition should use positional arguments instead of named
Why it's wrong here
Incorrect: Named arguments are valid.
- ✗
The macro definition should include a pipe before `eval`
Why it's wrong here
Incorrect: No pipe needed; invocation provides it.
Visual reference
Go deeper
Related to this question
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 →
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.