When i try to run below query I am getting an error
SELECT mean(usage_idle) from cpu GROUP BY host, time(5s),
ERR: error parsing query: aggregate functions with GROUP BY time require a WHERE time clause.
My idea is to create a CQ with multiple Group by Columns.
Can I get mean(usage_idle)/host with 5 minutes time interval
I am trying to create a CQ, to get output as ’ mean(usage_idle) from cpu of every host with time interval of 5 sec.
This is my query
CREATE CONTINUOUS QUERY “cpu_usage_idle_avg9” ON “telegraf” BEGIN SELECT mean(usage_idle) INTO “cpu_usage_idle_avg9” FROM cpu WHERE time > now() - 5m GROUP BY host, time(5s) END
But I am getting out put like this
select * from cpu_usage_idle_avg9
name: cpu_usage_idle_avg9
time host mean
@sai I believe that is every 10 seconds. If you are writing data every 10 seconds (the default with telegraf) then you will only get data out of that query every 10 seconds. That output makes sense to me.