Splunk Search

How do I write a search to filter out certain values for a field?

asarran
Path Finder

Hey Fellow Splunkers

I have an issue when searching for similar events that are only unique by one character.

Example: (L= lbs G=Grams)

Vegetables=5.1Lbs
Vegetables=2.1Gbs

Giving this example, If I search for Vegetable="*", it will populate both:

Vegetables=5.1Lbs
Vegetables=2.1Gbs

How can I search Vegetables="" and have it only populate:

Vegetables=2.1Gbs
Vegetables=9.2Gbs
Vegetables=4.3Gbs
Vegetables=3.5Gbs
Vegetables=2.8Gbs

Basically, i would like the emphasis of the search solely specifically with Vegetables, but only populate the events with "Gbs", not "Lbs"?

0 Karma

sundareshr
Legend

If you want to only return Gbs, try vegetables="*Gbs" OR NOT vegetable="*Lbs" (to catch everything except Lbs)

asarran
Path Finder

Thank You, i didn't realize how simple that was lol. I'm sorry.

0 Karma

sundareshr
Legend

Happens to all of us 🙂 If this worked for you, please accept the answer to close it out.

0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...