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!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...