Splunk ITSI

How to combine a few eval cases to a single search?

faizolsaidin
Explorer

Hi,

How could i combine few eval cases into single count search.

Search as below :

| eval a = case(Name LIKE "abc%efg%123" AND State="Running",1,Name LIKE "abc%efg%123" AND State!="Running",0) 
| eval b = case(Name LIKE "abc%efg%456" AND State="Running",1,Name LIKE "abc%efg%456" AND State!="Running",0) 
| eval c = case(Name LIKE "abc%efg%789" AND State="Running",1,Name LIKE "abc%efg%789" AND State!="Running",0) 
0 Karma

PowerPacked
Builder

Hi @faizolsaidin

Am not sure, if i understood your question correctly

But you can give multiple eval statements in single eval like below,

| eval a = case(Name LIKE "abc%efg%123" AND State="Running",1,Name LIKE "abc%efg%123" AND State!="Running",0),  b = case(Name LIKE "abc%efg%456" AND State="Running",1,Name LIKE "abc%efg%456" AND State!="Running",0), c = case(Name LIKE "abc%efg%789" AND State="Running",1,Name LIKE "abc%efg%789" AND State!="Running",0) 

Thanks

0 Karma

faizolsaidin
Explorer

My bad, my question should be with the query that i had from the eval cases above, i would like to combine it in order to monitor all cases in single search instead to have it separately. Since it was part of my base search but i'm creating this of 1 piece in my Glass table. Hope this helps to clarify.

0 Karma
Get Updates on the Splunk Community!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Deprecation of Splunk Observability Kubernetes “Classic Navigator” UI starting ...

Access to Splunk Observability Kubernetes “Classic Navigator” UI will no longer be available starting January ...