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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...