Splunk Search

How to manually save a saved search which contains backslashes \ in the query to savedsearches.conf?

pavanae
Builder

I have a splunk query as below which contains a lot of backslashes

 index="ABC" os="Win" FileName="*\\Programs\\Startup\\*" | rex field=FileName "Users\\\(?<username>[^\\\]+)." 

Now, I now that when I tried to add this in savedseacrhes.conf it wont work as expected as in Splunk it breaks the line when it sees backslash. 

 

Any suggestion on how we can add it to saved searches.conf  ?

 

 

 

 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

I've seen lots of backslashes in savedsearches.conf.  The only special use for them is as a line continuation character and that's only when \ is the last character on a line.  Have you tried putting that query in the config file?

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...