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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...