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.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...