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!

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