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!
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)
.