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!

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

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

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