Splunk Search

i have a query that outputs a chart with 3 columns. I want to output another column that has the delta between the column 2 and 3.

shrey12
Explorer

Query : MSTC>0 run_id=123 OR run_id=456 | sort 0 MSTC | rename "Actual Battery Power _B0AP" as Battp | chart avg(Battp) as Battery by MSTC, run_id

Chart is as follows
MSTC 123 456 delta(Column that I need help with)
1 5 5 0
2 6 5.9 0. 1
3 10 10.5 0.5

Tags (2)
0 Karma
1 Solution

woodcock
Esteemed Legend

Try this:

MSTC>0 run_id=123 OR run_id=456 | sort 0 MSTC | rename "Actual Battery Power _B0AP" as Battp | chart avg(Battp) as Battery by MSTC, run_id | eval Delta=run_id-Battery

View solution in original post

0 Karma

woodcock
Esteemed Legend

Try this:

MSTC>0 run_id=123 OR run_id=456 | sort 0 MSTC | rename "Actual Battery Power _B0AP" as Battp | chart avg(Battp) as Battery by MSTC, run_id | eval Delta=run_id-Battery
0 Karma
Get Updates on the Splunk Community!

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud

Introduction to Splunk Observability Cloud - Building a Resilient Hybrid Cloud  In today’s fast-paced digital ...

Observability protocols to know about

Observability protocols define the specifications or formats for collecting, encoding, transporting, and ...

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...