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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...