0
votes

Hi I'm trying to do a continuous query in version 1.8 of influxDB. I'm noticing none of the documentation works, firstly because i need to enter the continuous query into the terminal with no return characters (documentation shows return characters probably to make it easier to read), but also putting a comma and adding another select statement gives me a parse error. Here's my command and the parser error:

CREATE CONTINUOUS QUERY "old_data_cc" ON "admin" BEGIN SELECT mean("value") as "mean", SELECT min("value") as "min", SELECT max("value") as "max" INTO "old_data" FROM "default" GROUP BY time(1h) END

ERR: error parsing query: found SELECT, expected identifier, string, number, bool at line 1, char 84

1
WHy are you using multiple selects? Try: CREATE CONTINUOUS QUERY "old_data_cc" ON "admin" BEGIN SELECT mean("value") as "mean", min("value") as "min", max("value") as "max" INTO "old_data" FROM "default" GROUP BY time(1h) ENDYuri Lachin
@YuriLachin It works doing with your advice. If you'd like to post that as the answer I'll gladly accept your response. I put in multiple selects because i thought each new line needed to start with an action keyworduser1709076

1 Answers

1
votes

Multiple SELECTs aren't needed. Try:

CREATE CONTINUOUS QUERY "old_data_cc" ON "admin" BEGIN SELECT mean("value") as "mean", min("value") as "min", max("value") as "max" INTO "old_data" FROM "default" GROUP BY time(1h) END