Splunk Search

sum the 3 numbers in a eval statement?

splunkranger
Path Finder

my search returns 3 numbers

acount, bcount, ccount
1 0 1
2 4 3

I would like to be able use eval to create a sum of these three fields, is this possible?

eval totalcount=acount+bcount+ccount?

Sorry if this is not very clear..

thank you,

Tags (1)
0 Karma

yannK
Splunk Employee
Splunk Employee

yes, it works.
eval totalcount=acount+bcount+ccount

or if you want to sum all the columns, use the command
| addtotals

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

That's more than possible, with precisely the eval call you posted.

Is there more to the question than that?

0 Karma

splunkranger
Path Finder

Thank you, however for some reason I was not getting a result. addtotals is working for me.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

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