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!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...