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
SplunkTrust
SplunkTrust

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!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...