- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
paullt12345
Explorer
03-11-2019
08:29 PM
Hi
I need to do a sum of all columns into new column
EVNT COL1 COL2 COL3 SUM
1 22 22 22 66
2 1 0 0 1
-paull
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

vnravikumar
Champion
03-11-2019
09:05 PM
Hi
You can try
| makeresults
| eval EVNT=1,COL1=22,COL2=22,COL3=22,SUM=0
| foreach COL*
[ eval SUM = SUM+<<FIELD>>]
| table EVNT,COL1,COL2,COL3,SUM
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

renjith_nair
Legend
03-11-2019
09:06 PM
@paullt12345 ,
Just add |addtotals fieldname=sum
to your search and you get a new sum field
https://docs.splunk.com/Documentation/SplunkCloud/7.2.4/SearchReference/Addtotals
---
What goes around comes around. If it helps, hit it with Karma 🙂
What goes around comes around. If it helps, hit it with Karma 🙂
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ClubMed
Path Finder
02-28-2024
05:40 PM
5 years later and I came upon this. This should be the actual, concise answer for OP's question.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
paullt12345
Explorer
03-11-2019
09:19 PM
Thanks it also works as expected.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

vnravikumar
Champion
03-11-2019
09:05 PM
Hi
You can try
| makeresults
| eval EVNT=1,COL1=22,COL2=22,COL3=22,SUM=0
| foreach COL*
[ eval SUM = SUM+<<FIELD>>]
| table EVNT,COL1,COL2,COL3,SUM
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
paullt12345
Explorer
03-11-2019
09:19 PM
Thanks...
