Timelion(5.6.3) - how to query avg per bucket per distinct identifer

Hi all
I have 2 devices D1 & D2 whom give every 1 minute a sample
every sample has the change between current and last (delta).

if I have a bucket of 3 samples for D1 e.g :
I would like for a single device to show me there 20
so this simple query :

.es(index=ssl*, q='_type:bandwidth ',metric=avg:delta_count)

now I need the same thing in case I have more then one device and I would like the output to represent per device avg
so for
D1(10,20,30) = 20
D2(50,60,70) = 60
I would like to get (60+20 )/ 2 = 40
where this query

i need to get every device avg to calculate it

.es(index=ssl*, q='_type:bandwidth ',metric=avg:delta_count).multiply(.es(index=ssl*, q='_type:concurrentconnections ' ,metric='cardinality:device_id.keyword'))

is there a way to do the same thing without using cardinality:device_id and using split instead ?

cc @thomasneirynck

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.