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!

.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 ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...