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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

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 Certification at ...

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