Splunk Search

How to create a search to extract and compare values?

rajs115
Path Finder

Hi,

  I need help with below query search. Below is the sample logs.

Logs:

Conatainer: dev_test_cluster
CountRequired: 2
CountRunning: 1
FunctionName: dev_dd_app


I need to write a query for to compare the CountRequired and CountRunning values and show details when CountRunning is less than CountRequired.

Appreciate the help.

Labels (3)
Tags (1)
0 Karma
1 Solution

jamie00171
Communicator

Hi @rajs115 

 

Does something like this work for you:

 

index=<your index> sourcetype=<your sourcetype>
| eval RunningLessThanRequired = if(CountRunning < CountRequired, 1, 0)
| where RunningLessThanRequired = 1

View solution in original post

rajs115
Path Finder

Thanks Jamie. It worked

0 Karma

jamie00171
Communicator

Hi @rajs115 

 

Does something like this work for you:

 

index=<your index> sourcetype=<your sourcetype>
| eval RunningLessThanRequired = if(CountRunning < CountRequired, 1, 0)
| where RunningLessThanRequired = 1
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...