Splunk Search

Error in 'SearchParser': Missing a search command before '''. Error at position '264' of search query

qhmassc
Explorer

I configured a Macro name securemsg(1), I use this Marco in the following search:

....| eval log_info=_raw | 'securemsg(log_info)' | ....

When I run this search I got following error:

Error in 'SearchParser': Missing a search command before '''. Error at position '264' of search query 'search index="linuxos" sourcetype="syslog" host="C...{snipped} {errorcontext = fo=_raw | 'securemsg(}'.

Please help.

Thanks

 

 

 

Labels (2)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You have now used double quotes - try back quotes

`

Put your cursor in the search window and press <ctrl><shift>E keys together

View solution in original post

0 Karma

qhmassc
Explorer

I changed to  ....| eval log_info=_raw | "securemsg(log_info)" | ..., but got the same error

how to use  <ctrl><shift>E to expand the macro?

Thanks

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You have now used double quotes - try back quotes

`

Put your cursor in the search window and press <ctrl><shift>E keys together

0 Karma

qhmassc
Explorer

Thanks, You are right!  Need to use back quotes

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

It looks like you are using single quotes around the macro rather than backquotes

Are you sure the macro expands correctly - try using <ctrl><shift>E to expand the macro

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...