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!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...