SPLK-1002 Macros, Saved Searches and CIM Practice Question
A macro is defined as `mysearch` with definition `index=main | stats count by $source_type$`. The macro is invoked as `| `mysearch(access_combined)` but the search never finishes. What is the 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 uses a named argument but the invocation passes an unnamed argument
The macro definition uses `$source_type$` which is a named argument. In the invocation `| `mysearch(access_combined)``, the argument is passed positionally without the argument name. For named arguments, the invocation must specify the argument name, like `source_type=access_combined`. This mismatch causes the macro to treat `$source_type$` as a literal string instead of substituting the passed value, leading to the search never finishing because it's probably looking for a field that doesn't exist. Option B is incorrect because the quotes are not the issue; the problem is the positional vs. named argument mismatch. Option A is incorrect because there is no syntax error in the definition. Option D is incorrect because a filter is not required before stats.
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 definition contains a syntax error
Why it's wrong here
Incorrect: The definition is syntactically correct.
- ✗
The macro argument should not be in quotes
Why it's wrong here
Incorrect: Quotes are fine for arguments.
- ✓
The macro definition uses a named argument but the invocation passes an unnamed argument
Why this is correct
Correct: Named arguments require name=value syntax.
- ✗
The macro definition requires a filter before the stats command
Why it's wrong here
Incorrect: The definition already has index=main.
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.