One quick note, any "WHERE time" clause in a CQ is ignored. The CQ explicitly generates the "WHERE time" parameters at execution time.
> The resulting values seems to be correct but I'm only interested in the last value. Is there some way to achive this within this query or should I take the approach of letting this data be stored in a temporary measurement and have another CQ get the last value from it? Unless the load on the system is a problem, just use LAST() to grab the last value from the onehoursumofhosts measurement. There is no way to tell the CQ to run only for a portion of the hour. I think that's actually a subtle bug and have opened https://github.com/influxdata/influxdb/issues/6963 to address it. On Fri, Jul 1, 2016 at 7:00 AM, <[email protected]> wrote: > Hello, I have a problem contructing a CQ that should add SNMP counters > from different hosts fetched via Telegraf. > > The continuous query should run every hour and get the latest entry for > each SNMP host and add those values and put them in a new measurement. > > Right now i'm trying > CREATE CONTINUOUS QUERY CQname ON used_data_base RESAMPLE EVERY 1h BEGIN > select sum(countername) AS sum_of_hosts INTO onehoursumofhosts from > snmpcountermeasurement WHERE time > now() - 10s GROUP BY time(10s) END > > The resulting values seems to be correct but I'm only interested in the > last value. Is there some way to achive this within this query or should I > take the approach of letting this data be stored in a temporary measurement > and have another CQ get the last value from it? > > -- > Remember to include the InfluxDB version number with all issue reports > --- > You received this message because you are subscribed to the Google Groups > "InfluxDB" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > 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/16937e49-7ff0-44a0-b15f-2bec50db48b6%40googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > -- Sean Beckett Director of Support and Professional Services InfluxDB -- Remember to include the InfluxDB version number with all issue reports --- You received this message because you are subscribed to the Google Groups "InfluxDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. 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/CALGqCvPRcntMeSSB0dE52fCXVmKFnQK93Ot3iOg-AQnU%2BBiqwA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
