正解:B
Reference:https://docs.splunk.com/Documentation/Splunk/8.0.3/Knowledge/Definesearchmacros
The macro definition below shows a macro that tracks user sessions based on two arguments: action and
JSESSIONID.
sessiontracker(2)
The macro definition does the following:
It specifies the name of the macro as sessiontracker. This is the name that will be used to execute the macro in
a search string.
It specifies the number of arguments for the macro as 2. This indicates that the macro takes two arguments
when it is executed.
It specifies the code for the macro asindex=main sourcetype=access_combined_wcookie action=$action$
JSESSIONID=$JSESSIONID$ | stats count by JSESSIONID. This is the search string that will be run when
the macro is executed. The search string can contain any partof a search, such as search terms, commands,
arguments, etc. The search string can also include variables for the arguments using dollar signs around them.
In this case, action and JSESSIONID are variables for the arguments that will be replaced by their values when
the macro is executed.
Therefore, to correctly configure the macro, you should enter sessiontracker as the name and action,
JSESSIONID as the arguments. Alternatively, you can use sessiontracker(2) as the name and leave the
arguments blank.