Splunk Search

How to add new row in table on runtime

geetanjali
Path Finder

Hi,

i have data :

    host       max(Power_consumption)
1   ABC         150
2   XYZ         135

I want to add 150+135=285 and display it in next row and total.

    host        max(Power_consumption)
1   ABC         150
2   XYZ         135
    Total        285
Tags (1)
0 Karma

MarioM
Motivator

Did you try "| addtotals fieldname=Total max(Power_consumption)"?

MarioM
Motivator

if your field to do total is max(Power_consumption) just add it after it,and you can use several fields and wildcard too.
I modified my initial answer

0 Karma

geetanjali
Path Finder

addtotal will add all Power_consumption values from entire log. I need to add only maximum power consumption values

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...