First, you need to be very precise if you are to cite code snippet, even for pseudo code. `macros1(`$macros2$`, now(), -15d@d, *, virus, *, *, *)` is simply incorrect because Splunk will give you a...
See more...
First, you need to be very precise if you are to cite code snippet, even for pseudo code. `macros1(`$macros2$`, now(), -15d@d, *, virus, *, *, *)` is simply incorrect because Splunk will give you an error about macro macro1( not defined or no permission, or a similar error. When you open a macro invocation with a back tick, Splunk expects you to close it with the closest back tick. In your sample, Splunk will be looking for two macros, one named macros1(, the other named , now(), -15d@d, *, virus, *, *, *). I am certain that none of them exist. Second, do not name your token so similarly to the macro name so you don't confuse yourself during diagnosis. If this is pseudo code, do not name mock token so close to mock macro name, so you don't confuse volunteers here who are trying to help diagnose. Third, if a parameter is causing error in an macro, you need to explain how this parameter is being used inside that macro as well as how macro is invoked in actual search, so volunteers here do not waste their time reading your mind. I need OR condition to be performed on that case. Suppose your input has delimiter OR, and you first select stringA, then select stringB. Nothing else is defined. Your token would contain stringA OR stringB, as a bare string. Suppose your macro1(1) is search $mytok$ mytok being the token name you set in the macro (again, do not name it very close to the macro's own name), and if the search that invokes the macro is | `macro1($multiselect_tok$)` $multiselect_tok$ being the name of the token in the multiselect input. (You can name it semantically, but never too close to the macro's own name.) There will be no problem with the search. It will behave as if you entered | search stringA OR stringB Without relevant information about the macro and about the search that uses the macro, your question is unanswerable.