nerdexam
Splunk

SPLK-1002 · Question #148

The macro weekly_sales (2) contains the search string: index--games I eval Product Sales = $price$ $AmountS01d$ Which of the following will return results?

The correct answer is C. 'weekly_sales (3.99, 10). 'weekly_sales (3.99, 10)'. This is because search macros accept arguments without quotation marks or dollar signs, and the number of arguments must match the number of parameters defined in the macro. The other options are incorrect because they either use quotation marks or…

Creating and Using Macros

Question

The macro weekly_sales (2) contains the search string:

index--games I eval Product Sales = $price$ $AmountS01d$ Which of the following will return results?

Options

  • A'weekly_sales(3.99, 10) '
  • B'weekly_sales($3.99$, $10$)
  • C'weekly_sales (3.99, 10)
  • D'weekly_sales(3)

How the community answered

(40 responses)
  • A
    3% (1)
  • B
    3% (1)
  • C
    90% (36)
  • D
    5% (2)

Explanation

'weekly_sales (3.99, 10)'. This is because search macros accept arguments without quotation marks or dollar signs, and the number of arguments must match the number of parameters defined in the macro. The other options are incorrect because they either use quotation marks or dollar signs around the arguments, or they provide a different number of arguments than the macro expects. You can learn more about how to use search macros in searches from the Splunk

Topics

#Splunk macros#Macro arguments#Macro invocation#SPL syntax

Community Discussion

No community discussion yet for this question.

Full SPLK-1002 Practice