Sum of value from last value from series


I’m trying to get the sum of the last values of 2 or mores series, these are counters created by statsd telegraf plugin.

select last(“value”) FROM /provider.*.max_servers/

name: provider.provider1.max_servers
time last

1518448220000000000 10

name: provider.provider2.max_servers
time last

1518448240000000000 4

I have created a continuous query, but I can’t get the right result. (more providers will be created, I don’t have control on this). What is the best way to manage this ?

Thanks for your help =)


Try a nested query to generate this data

select sum(last) from (select last(“value”) FROM /provider.*.max_servers/)


Hello sbains,

Thanks for the answer, but it doesn’t work:

select sum(last) FROM (select last(“value”) FROM /provider.*.max_servers/)
name: provider1.max_servers
time sum

0 10
name: provider2.max_servers
time sum

0 4

It strange to not be able to do this simple query :confused: