Splunk Search

How to display a value of zero in a chart for negative values returned in a search?

tohalan
New Member

Hi Everyone,

Need some help on how to display the output value as zero in a chart when a negative result is returned.

Thank you
Kind regards,

Tags (2)
0 Karma

javiergn
Super Champion

If I understand correctly, you just want to return 0 if the value is negative, right?
If that's the case:

your base search
| eval myNewValue = if(oldValue < 0, 0, oldValue)
| chart foo bar by myNewValue

If not please provide an example

0 Karma
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...