Splunk Search

How to use NOT match condition in Case statement for Multi valued field

manjunath_0208
Loves-to-Learn Everything

|eval SNOW_Description=case(EMGC_ADMINSERVER_Status!="k1","Java Process EMGC_ADMINSERVER data not available in splunk on host, EMGC_ORACLE_Status!="k2","Java Process EMGC_ORACLE data not available in splunk on host)

 

Here I am trying to use multiple fields inside case statement. I am not getting correct output. How can this be achieved?

Labels (1)
0 Karma

manjunath_0208
Loves-to-Learn Everything

|eval SNOW_Description=case(EMGC_ADMINSERVER_Status!="k1","Java Process EMGC_ADMINSERVER data not available in splunk on host, EMGC_ORACLE_Status!="k2","Java Process EMGC_ORACLE data not available in splunk on host)

 

In the above query, I am getting the output if the first condition EMGC_ADMINSERVER_Status!="k1" is met.

I am expecting to get the output when both conditions EMGC_ADMINSERVER_Status!="k1 and EMGC_ORACLE_Status!="k2" are met.

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Case is evaluated from the left until a condition is met.

So if the first condition is met, subsequent ones are not evaluated. You might want to rethink your conditions/evaluation order.

richgalloway
SplunkTrust
SplunkTrust

What output are you getting and what output do you expect?  The title of the post says "multi valued field", but the body says "multiple fields".  That's two different things so which is the case?  The latter is commonplace and should work easily, whereas the former requires one or more mv* functions.

That looks like it should work once the quotation marks are matched up.

---
If this reply helps you, Karma would be appreciated.
0 Karma
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!

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, ...