Splunk Search

Splunk query for sum of fields

NAVEEN_CTS
Path Finder

Hi

i have a field A B C D
for example with following data
A B C D
1 2 3 4
1 2 2 3
2 3 3 4

I want a result "total" = Sum(A) + Sum(B)+ Sum(C) + Sum(D)
total = 4 + 7 + 8 +11
total = 30

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@NAVEEN_CTS

Can you please try this?

YOUR_SEARCH | stats sum(*) as * | addtotals

Sample Search:

| makeresults count=4 | eval A=1 | accum A | eval B=A,C=A,D=A | stats sum(*) as * | addtotals
Get Updates on the Splunk Community!

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

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...