Splunk Search

How do I use an If statement to set rangemap in Splunk?

karthi2809
Builder

how do I set if condition if the "failurepercentage" is greater than 10 as amber and greater than 20 should be severe.

eval failureStatus=if(failurePercentage < 10,"25",(if(failurePercentage>=3 AND failurePercentage<=10,"15","5"))) |rangemap field=failureStatus Low=0-10 Amber=11-20 Severe=21-30

Tags (2)
0 Karma

harsmarvania57
Ultra Champion

Hi

It looks like you used field=failureStatus instead of field=failurePercentage in rangemap.

0 Karma
Get Updates on the Splunk Community!

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 at Splunk .conf24 ...

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

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...