Yep, you can have a single database with multiple retention policies. For
example:

create RETENTION POLICY "1hour" on "telegraf" DURATION 1h REPLICATION 1
DEFAULT
create RETENTION POLICY "1day" on "telegraf" DURATION 1d REPLICATION 1
create RETENTION POLICY "1week" on "telegraf" DURATION 1w REPLICATION 1
create DATABASE another_telegraf

CREATE CONTINUOUS QUERY "1hour-to-1day-telegraf" on "telegraf" BEGIN SELECT
mean(*) INTO "telegraf"."1day".:MEASUREMENT FROM /.*/ GROUP BY time(1m) END
CREATE CONTINUOUS QUERY "1hour-to-1hour-telegraf" on "telegraf" BEGIN
SELECT mean(*) INTO "telegraf"."1hour".:MEASUREMENT FROM /.*/ GROUP BY
time(1h) END
CREATE CONTINUOUS QUERY "1hour-to-1week-telegraf" on "telegraf" BEGIN
SELECT mean(*) INTO "telegraf"."1week".:MEASUREMENT FROM /.*/ GROUP BY
time(1w) END
CREATE CONTINUOUS QUERY "1hour-to-1day-another_telegraf" on "telegraf"
BEGIN SELECT mean(*) INTO "another_telegraf"."autogen".:MEASUREMENT FROM
/.*/ GROUP BY time(1m) END

This will take data from the 'telegraf' database and put it into another
retention policy on the same database. But the other continuous query
"1hour-1d-another_telegraf" will take data from the "telegraf" database and
put it into the "autogen" retention policy (or any policy you specify) on
the "another_telegraf" database.



On Sat, Jan 20, 2018 at 12:56 AM, <rickstokk...@gmail.com> wrote:

> @Geno Is this CQ only working when the "INTO" is another database? or can
> is also be an other Retention policy in the same database. I tried it, and
> i'm not getting any data into the RP.
>
>
>
> __________________________________________________________
> name: telegraf
> name         query
> ----         -----
> cq_four_week CREATE CONTINUOUS QUERY cq_four_week ON telegraf BEGIN SELECT
> mean(*) INTO telegraf.four_weeks.:MEASUREMENT FROM telegraf.autogen./.*/
> GROUP BY time(5m), * END
> cq_a_year    CREATE CONTINUOUS QUERY cq_a_year ON telegraf BEGIN SELECT
> mean(*) INTO telegraf.a_year.:MEASUREMENT FROM telegraf.autogen./.*/ GROUP
> BY time(30m), * END
> __________________________________________________________
>
> --
> Remember to include the version number!
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxData" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to influxdb+unsubscr...@googlegroups.com.
> To post to this group, send email to influxdb@googlegroups.com.
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/influxdb/beb456d0-d674-447d-9d1c-3cad0acf2bf8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CAA2dGFsysB8mG%3D4AKpOz419c_6sKM1gMiQ6pXc1eYDHDrVzWgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to