Splunk Search

Can't I use backslashes in Splunk searches?

pavanae
Builder

I have a Splunk query as below which pulls some events.

 

index="windows_events" TargetFileName="*startup*"

 

 

Now from the events I picked the below TargetFileName field value 

 

 

\Device\HarddiskVolume3\Users\XYZ\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Send to AbC.lnk

 

 

Now I wanted to search specifically for the above field and for that I used the below query which gives me no results. 

 

 

`get_All_CrowdstrikeEDR` event_simpleName=FileCreateInfo os="Win" TargetFileName="*\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\*"

 

 

Now, what I dont understand is when I tried the first query I am able to see some events though I used wild cards before and after startup

 

Now, when I extended the wild card with actual value why isn't working?

 

Can't I use backslashes in Splunk searches?

Labels (6)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Have you tried escaping the backslashes?  The \ character is used for escaping so to specify a \ you must escape it.

`get_All_CrowdstrikeEDR` event_simpleName=FileCreateInfo os="Win" TargetFileName="*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*"

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Have you tried escaping the backslashes?  The \ character is used for escaping so to specify a \ you must escape it.

`get_All_CrowdstrikeEDR` event_simpleName=FileCreateInfo os="Win" TargetFileName="*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*"

 

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

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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