Splunk Search

How to compare numbers before and after a special char?

HelloItsMe76
Explorer

Hello, 

I have a log file that spits out data like the below. I want to be able to evaluate the the numbers either side of the "/" and alert if they are not the same. How can i do this? The will only be 1 "/" per line. The last line below that has "1/3" would be the only line i want returning. 

The data below is not in table form in the log file, its just text.  

 

NAME READY STATUS RESTARTS AGE

Process1 2/2 Running 0 8d

Process2ab  2/2 Running 0 8d

Process 3abc  1/3 Running 0 8d

 

Labels (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

There probably are a few ways to do that.  Here's one.

<<your search>>
| rex "\s(?<a>\d+)\/(?<b>\d+)"
| where a!=b
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

Get Inspired! We’ve Got Validation that Your Hard Work is Paying Off

We love our Splunk Community and want you to feel inspired by all your hard work! Eric Fusilero, our VP of ...

What's New in Splunk Enterprise 9.4: Features to Power Your Digital Resilience

Hey Splunky People! We are excited to share the latest updates in Splunk Enterprise 9.4. In this release we ...