Hi,
I'm using the following datamodel search:
| datamodel Test_Ping_Access summariesonly=true search | search "Ping_Access__TEST.date"=$date$ | stats count(exchangeId)
And I've confirmed its working, but when I use it in a macro I get this error:
Error in 'SearchParser': The datamodel command can only be used as the first command on a search
How can I resolve this?
When creating a macro that uses a generating command, such as datamodel or inputlookup, you need to leave the | symbol out of the macro definition, so your macro will just be
datamodel Test_Ping_Access summariesonly=true search | search "Ping_Access__TEST.date"=$date$ | stats count(exchangeId)
and then you use it like this
| `my_datamodel_macro(date)`
When creating a macro that uses a generating command, such as datamodel or inputlookup, you need to leave the | symbol out of the macro definition, so your macro will just be
datamodel Test_Ping_Access summariesonly=true search | search "Ping_Access__TEST.date"=$date$ | stats count(exchangeId)
and then you use it like this
| `my_datamodel_macro(date)`
Thanks!