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 | What is broken 80% of the time by February?

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

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...