Splunk Search

Eval=case not working

stevenbutterwor
Path Finder

Probably a simple one but......my Eval case statement does not seem to work correctly

...| eval operation=case(TagValue >0, "Running", True(), "Off") | table TagValue operation

When the TagValue is 0.00446 I am still getting "Running". Any idea why?

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hi @stevenbutterworth,

As per condition defined in case, if TagValue is greater than 0 then "Running". And your TagValue is 0.00446 So getting value "Running" is proper. Can you please clear me if I'm wrong..?

bjoernhansen
Path Finder

Would agree on that. Also, for the case shown above, you can simply use if() instead of case() 🙂

0 Karma

FrankVl
Ultra Champion

Because 0.00446 is larger than 0?

Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...