Splunk Search

Filter subset of search results

ghostrider
Path Finder

I am trying to filter my search results where only a particular subset of the results should be shown. Example suppose if below is the intermediate search result. 

MESSAGE: Records::0

MESSAGE: Records::1

MESSAGE: Records::0

MESSAGE: Records::4

Final search results should contain only where the records are greater than 0. Is there any query which can help with this?

Labels (4)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @ghostrider,

if you already extracted the Records field, it's easy and you can run:

index=your_index Records>0
| ...

if you didn't extracted the field, you have to extract it, something like this:

index=your_index 
| rex "MESSAGE:\s+Records::(?<Records>\d+)"
| where Records>0
| ...

I could be more sure and detailed if you can share some full sample of your logs.

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...