Splunk Search

How to modify delta search to convert negative values in results to positive values?

nramya82
Explorer

Hi ,

I need to make a graph for the delta_f where i am finding the difference of current value and next value . By using the query below I get some negative values. Can any one help me find what needs to be added in my search to convert all the negative values into positive values?

|search abc| eval delta_f= nextValues - currentValues | timechart span=1d sum(delta_f)

eg: say for delta_f = (nextvalue) - (currentvalue)

0000986 - 5362722 = -5361736 Instead i want only 5361736

Tags (1)
1 Solution

adauria_splunk
Splunk Employee
Splunk Employee

Pipe results to an eval statement like

eval delta_f = abs(delta_f)

Which converts to absolute value

View solution in original post

adauria_splunk
Splunk Employee
Splunk Employee

Pipe results to an eval statement like

eval delta_f = abs(delta_f)

Which converts to absolute value

nramya82
Explorer

Yep that worked . Thanks a lot !

0 Karma

ppablo
Retired

Hi @nramya82

Glad @adauria_splunk helped you find your solution 🙂 You used eval to find the difference between your field values, but there actually is a delta command for this purpose, just so you know for future reference. Check out the documentation for it here:
http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Delta

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...

Index This | How many sevens are there between 1 and 100?

August 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...