Splunk Search

How to generate a search when a field value total is less than 21?

yograjpatel
New Member

The Log output is below:

Need to search if Port 2003 farm total < 21

6/6/17
3:35:01.000 PM

Tue Jun 6 15:35:01 EDT 2017
Port 2003 = PLD
Port 2004 = CC
Port 2005 = Settlement
Port 2003 farm total = 21
dukerwpv01_2003 = 6
dukerwpv02_2003 = 15
dukerwpv03_2003 = 0
Port 2004 farm total = 21
dukerwpv01_2004 = 1
dukerwpv02_2004 = 6
dukerwpv03_2004 = 14
Port 2005 farm total = 40
dukerwpv01_2005 = 11
dukerwpv02_2005 = 17
dukerwpv03_2005 = 12

0 Karma

yograjpatel
New Member

Thanks woodcock and cmerriman.. both answers worked.

0 Karma

woodcock
Esteemed Legend

Like this:

index=YourIndexHere sourcetype=YourSourcetypeHere Port 2003 farm total
| rex "Port 2003 farm total\s*=\s*(?<port2003farmtotal>\d+)"
| search port2003farmtotal<21
0 Karma

cmerriman
Super Champion

maybe something like this if you don't have that field extracted yet, otherwise if you do, you should just need the search:

rex "Port 2003 farm total = (?<port2003farmtotal>\d+)"|search port2003farmtotal<21
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

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