Splunk Search

How come our negative field search is looking in all the fields instead of the searched field?

jonaspereira
New Member

I have a Splunk local installation that is having some strange behavior. The search is filtered by negative field extractions before a specific date, and it isn't retrieving the expected results. The negative search is being applied to all the fields.

So, for example, if I search for 'FieldA="foo" AND FieldB!="foo", no results will be retrieved even if none of the entries in FieldB have "foo" as a value.

Tags (1)
0 Karma

493669
Super Champion

check if there is any space or tab in value and to remove spaces you can use trim function as

|eval FieldA=trim(FieldA), FieldB=trim(FieldB)

try this run anywhere run search which works as expected if there is no space in values-

| makeresults |eval a="foo", b="f"|append[| makeresults |eval a="boo", b="ghh"]|append[| makeresults |eval a="foo", b="fsi"]|append[| makeresults |eval a="foo", b="foo"]
|search a="foo" b!="foo"
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...