Show answerHide answer
Correct answer: C Place the variable name inside of dollar signs: $variable name$.
Explanation
ExplanationWhen defining a macro with arguments, you reference those arguments inside the macro definition by enclosing them in dollar signs ($). The dollar sign format is $arg1$ or $argument_name$ (if using named arguments). This tells Splunk to substitute the actual value passed to the macro when it is called.
❌ Why the other options are incorrect
A. Place the variable name inside of curly braces: {variable_name}. – Curly braces are used in other contexts (e.g., where with field names), but they are not used for macro variable syntax. Macro arguments require dollar signs, not curly braces.
B. Place the variable name inside of asterisks: variable_name. – Asterisks are used as wildcards in search patterns (e.g., error*), but they are not used for macro variable substitution.
D. Place the variable name inside of percentage signs: %variable_name%. – Percentage signs are not used for macro variables in Splunk. This is a distractor.
Splunk Documentation:
"In the macro definition, you reference the arguments with dollar signs, such as 1 or argume ntnameargument n ame."