Splunk Search
Highlighted

Adding a row of Totals

Path Finder

Hi all, currently I'm using a search

Which gives me something like this for each group/event

 Group           Bundle             Installs        MM     Total_Installs     Totals_MM
 1                  1a                 3            50           10               80  
                    2a                 2            20      
                    3a                 5            10
 ____________________________________________________________________________

However i was wondering if i could change it so that i get something like this, with the totals as a row at the bottom of the event

  Group           Bundle             Installs        MM     
       1                1a                  3            50                        
                        2a                  2            20      
                        3a                  5            10

 Group_1_Totals                            10            80

Is there any way i can do this? I tried using the addcoltotals and addtotals commands but they didn't seem to work, thank you!

0 Karma
Highlighted

Re: Adding a row of Totals

SplunkTrust
SplunkTrust

Just something like this to end of you search. Since the appendpipe below will give you total already, you can remove the code to calculate in your previous stats)

Your current search giving  results by Group |  appendpipe [| stats sum(Field1) as Field1 sum(Field2) as Field2..List all fields which you want to sum... by Group ] | sort Group

View solution in original post

Highlighted

Re: Adding a row of Totals

Path Finder

hmmm its close but its giving me the totals in a different column, is there any way to make this appear directly under the field?

0 Karma
Highlighted

Re: Adding a row of Totals

SplunkTrust
SplunkTrust

It will show under the same field if you've correctly done the renaming in the stats within appendpipe.

| stats sum(Field1) as Field1 will give total of all values of Field1 and list it under Field1 only.

If you don't mind, could you paste the query that your tried?

0 Karma