QuestionQ21Verified/Creating and Using MacrosCopy linkReport a problemAsk AstroTutorSave questionWhich of the following searches illustrate a valid use of a macro?Choose twoAindex=main source=mySource oldField=* |'makeMyField(oldField)'| table _time newFieldBindex=main source=mySource oldField=* | stats if('makeMyField(oldField)') | table _time newFieldCindex=main source=mySource oldField=* | eval newField='makeMyField(oldField)'| table _time newFieldDindex=main source=mySource oldField=* | "'newField('makeMyField(oldField)')'" | table _time newFieldShow AnswerAnswerExplanationSplunk macros must be enclosed in backticks, with any arguments inside the macro call. A command-style macro can be inserted as a piped search fragment, and an eval-expression macro can be used as the expression assigned by eval. Macros within quoted values are not expanded, and if is not a standalone statistical function accepted by stats.Learn moreUse search macros in searchesmacros.confShow comments1Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion