Splunk Search

Why does my search not find the "_".

ericrobinson
Path Finder

I have tried escaping the underbar to no avail..

My string is

"L1_a123456"

I can see all events matching the first part up to the _

e.g. "L1"

As soon as I add the "_", the search returns no results.

Please help!

Tags (1)
0 Karma

sowings
Splunk Employee
Splunk Employee

Splunk treats the _ as a "segmenter", meaning that it's used to break apart terms. Another example of a segmenter is " ", as is ".". So when you're searching for an IP address, for example, Splunk is actually searching its indexes for all of the octets within the IP address separately.

You can read more about segmentation here:
http://docs.splunk.com/Documentation/Splunk/5.0.1/Data/Abouteventsegmentation

And here:

http://docs.splunk.com/Documentation/Splunk/5.0.1/Data/SetsegmentationinSplunkWeb

In the near term, you might try putting the "TERM" function/operator around your search phrase, like TERM(L1_a123456).

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...