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!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...