Splunk Search

How to get the sum of each columns?

HideOnCode82
Engager

Hello everyone,

Thanks for reading, my english is not good at all.

I have this:

A B C D E F G
1 1 0 4 1 0 0
1 2 0 2 2 0 9
0 0 0 1 3 0 8
0 1 0 0 4 0 9
0 0 0 9 5 0 0
0 0 0 8 0 0 0
0 0 0 0 0 1 0
0 0 0 0 0 0 0

 

So, i need sum all value of each column

I would like to have this:

Column sum
A 2
B 4
C 0
D 24
E 15
F 1
G 26
Labels (3)
Tags (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @HideOnCode82,

what is your search? could you share it?

Anyway, see the addcoltotals command (https://docs.splunk.com/Documentation/Splunk/8.2.5/SearchReference/Addcoltotals) to have the sums you need at the bottom of your table.

If instead you want only the total row reversed, it's possible but you have to work a little, if you could share your search I could help you.

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @HideOnCode82,

what is your search? could you share it?

Anyway, see the addcoltotals command (https://docs.splunk.com/Documentation/Splunk/8.2.5/SearchReference/Addcoltotals) to have the sums you need at the bottom of your table.

If instead you want only the total row reversed, it's possible but you have to work a little, if you could share your search I could help you.

Ciao.

Giuseppe

HideOnCode82
Engager

Thanks you so much!!!

It worked perfect!

 

0 Karma
Get Updates on the Splunk Community!

Enter the Dashboard Challenge and Watch the .conf24 Global Broadcast!

The Splunk Community Dashboard Challenge is still happening, and it's not too late to enter for the week of ...

Join Us at the Builder Bar at .conf24 – Empowering Innovation and Collaboration

What is the Builder Bar? The Builder Bar is more than just a place; it's a hub of creativity, collaboration, ...

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...