nerdexam
Splunk

SPLK-1002 · Question #228

Based on the macro definition shown below, what is the correct way to execute the macro in a search string?

The correct answer is B. Convert_sales (euro, , .79). The correct way to execute the macro in a search string is to use the format macro_name($arg1$, $arg2$, ...) where $arg1$, $arg2$, etc. are the arguments for the macro. In this case, the macro name is convert_sales and it takes three arguments: currency, symbol, and rate. The arg

Creating and Using Macros

Question

Based on the macro definition shown below, what is the correct way to execute the macro in a search string?

Exhibit

SPLK-1002 question #228 exhibit

Options

  • AConvert_sales (euro, , 79)"
  • BConvert_sales (euro, , .79)
  • CConvert_sales ($euro,$$,s79$
  • DConvert_sales ($euro, $$,S,79$)

How the community answered

(19 responses)
  • A
    5% (1)
  • B
    79% (15)
  • C
    11% (2)
  • D
    5% (1)

Explanation

The correct way to execute the macro in a search string is to use the format macro_name($arg1$, $arg2$, ...) where $arg1$, $arg2$, etc. are the arguments for the macro. In this case, the macro name is convert_sales and it takes three arguments: currency, symbol, and rate. The arguments are enclosed in dollar signs and separated by commas. Therefore, the correct way to execute the macro is convert_sales($euro$, $$, .79).

Topics

#Splunk macros#Macro execution#Macro arguments#Search syntax

Community Discussion

No community discussion yet for this question.

Full SPLK-1002 Practice