Splunk Search
Highlighted

how to call a macro from the CLI

Communicator

how to call a macro from the CLI ? I tried splunk search " * | mymacro | table *" and got Error in 'SearchParser': Missing a search command before '|'.

Tags (3)
Highlighted

Re: how to call a macro from the CLI

Splunk Employee
Splunk Employee

To call a macro from the cli, please use the escaped ` characters. (not ' not ") example to call the macro testmacro

in the GUI:   index=_internal | `testmacro` | table itime

in the CLI:    splunk search " index=_internal | \`testmacro\` | table itime "

View solution in original post