> Find all series _with_ recent data. And then subtract it from the whole set.
This is the only solution I can see working with the current query language tools. A series doesn't know when it's most recent point exists. There's no way to ask the system for "all series with no points in this time range". I'm curious what the use case is for dropping data this way instead of using retention policies. DROP SERIES is assumed to be an infrequent operation and is not particularly performant. If you plan on running it routinely you may face performance challenges. On Wed, Jun 29, 2016 at 4:50 AM, <[email protected]> wrote: > Hi, > > I would like to get a list of series which don't have any recent data. The > goal is to periodically delete such series (note: this is very different > from retention policy). > > The naive query would be.. > > SELECT last(time) FROM cpu WHERE last(time) < now() - 1d GROUP BY * > > Unfortunately, you cannot select last(time), but you can do > last(<somefield>). > > SELECT last(usage_user) FROM cpu WHERE last(time) < now() - 1d GROUP BY * > > That does not work either, becuase "last(time)" is not a valid expression > for the timestamp-of-last-datapoint. > > ERR: invalid expression: last(time) > '2016-06-28T11:20:04.209687973Z' > > Right now, the only solution that comes to my mind is to do the opposite. > Find all series _with_ recent data. And then subtract it from the whole set. > > # series with the recent data > SELECT last(usage_user) FROM cpu WHERE time > now() - 1d GROUP BY * > > I would have to parse output of that select, match it with output of SHOW > SERIES and then convert to list of DROP SERIES. The whole task will turn > into quite complex awk mess very soon. > > Before doings so, I would like to ask if there isn't a more elegant way. > > Thanks, > > Brano Zarnovican > > -- > 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/f48a8fee-c67a-4042-8561-1fdb0160d9d5%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/CALGqCvMvQ0Y7bRCbMrPu%3DY1NrwAiMEj9fbVofxzMxM3PS8VyHA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
