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

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...