Splunk Search

Getting average of variable name fields

yurykiselev
Path Finder

Hi!

...
| streamstats count as SESSION by PATIENT_ID PROGRAM_NAME
| chart values(AVG_RT) over SESSION by PROGRAM_NAME limit=0 

SESSION 0 A 1 A-Rhythmical  2 Inhibition    3 Diff inhibition   4 Shifting  5 Attention
__________________________________________________________________________________________________
1         0.76              0.75            0.76                 1.80          1.03           0.96
                            0.77            0.79                 1.84          1.05           1.02
                            0.80            0.80                               1.09           1.19
                            0.82            0.82                                              1.27
                            0.83            0.79                                              1.30
                                                                                              1.31

2         0.79              0.78             ...
                            0.75

"0 A", "1 A-Rhythmical" are PROGRAM_NAMEs i.e. the name of these fields are variable. I would like to get average of its multivalues for each program name by SESSION:

SESSION 0 A 1 A-Rhythmical  2 Inhibition    3 Diff inhibition   4 Shifting  5 Attention
__________________________________________________________________________________________________
1         0.76              0.79            0.79                 1.82          1.06           1.16
2         0.79              0.77             ...
Tags (1)
0 Karma
1 Solution

niketn
Legend

@yurykiselev, just change from values(AVG_RT) to avg(AVG_RT).

<YourBaseSearch>
| chart avg(AVG_RT) over SESSION by PROGRAM_NAME limit=0 
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

@yurykiselev, just change from values(AVG_RT) to avg(AVG_RT).

<YourBaseSearch>
| chart avg(AVG_RT) over SESSION by PROGRAM_NAME limit=0 
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

yurykiselev
Path Finder

So simple! Thank you!

0 Karma

niketn
Legend

You were already there... Glad it worked!!! 🙂

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...