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!

Splunk Platform | Upgrading your Splunk Deployment to Python 3.9

Splunk initially announced the removal of Python 2 during the release of Splunk Enterprise 8.0.0, aiming to ...

From Product Design to User Insights: Boosting App Developer Identity on Splunkbase

co-authored by Yiyun Zhu & Dan Hosaka Engaging with the Community at .conf24 At .conf24, we revitalized the ...

Detect and Resolve Issues in a Kubernetes Environment

We’ve gone through common problems one can encounter in a Kubernetes environment, their impacts, and the ...