Dashboards & Visualizations

How to search field for input with backslash

altink
Builder

Dear All,

I am stuck on an always empty result when searching with a form input that contains Backslash "\"
To illustrate the case, I have some Windows Event log records loaded in Splunk, and available values for the field OS_USER are:

Administrator 
NT AUTHORITY\SYSTEM
DEV001\Administrator 

I have a simple form, with a drop-down box, in which user is supposed to filter records by OS user name.
When I search with * default or Administrator (choice 1) - I do get the results.

When I search with any of the two other choices (containing Backslash) - I receive "No results found. " This is an error because the records are there, for both back-slashed options.

I tried the CDATA and |s$ - to no result.
Browsed the answers - but found nothing.

Can one please advise on this painful Backslash issue ?
Even telling me that it is better to REMOVE the backslash right at the moment of the data ingest and not deal with it at all!

at your disposal for further info

best regards
Altin

ps. my form is Simple XML

0 Karma
1 Solution

DalJeanis
Legend

I believe the issue is that the value needs to have quotes around it when it arrives in the SPL.

Try this ..

  | search USERNAME = "$field_username$" OS_USER="$field_os_user_aa$" 

If that doesn't work, then you might need to convert the syntax to use match().

  <choice value="NT AUTHORITY\\SYSTEM">NT AUTHORITY\SYSTEM</choice>

 ....

  | search USERNAME = "$field_username$" AND match(OS_USER,"$field_os_user_aa$") 

View solution in original post

Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...