Splunk Dev

Evaluate an if/then expression?

msarro
Builder

Hey everyone. I am trying to create a dashboard; one of the primary items we're looking to create is a composite score of a number of metrics. Basically if item A is below a certain level it is rated 0, if its above a certain level it is rated 1. This is done for a number of items. The items are then totalled, and divided by the number of items to give us an average. How can I do the branch logic in eval statements? Is it possible?

Tags (1)
0 Karma
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

There is an if() eval function:

... | eval rating=if(A < level , 0, 1) | ...

View solution in original post

gkanapathy
Splunk Employee
Splunk Employee

There is an if() eval function:

... | eval rating=if(A < level , 0, 1) | ...

msarro
Builder

Thanks! I actually found it after some searching. Very much appreciated 🙂

0 Karma
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 ...