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!

Monitoring Postgres with OpenTelemetry

Behind every business-critical application, you’ll find databases. These behind-the-scenes stores power ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...

Splunk Edge Processor | Popular Use Cases to Get Started with Edge Processor

Splunk Edge Processor offers more efficient, flexible data transformation – helping you reduce noise, control ...