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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...