Discussion:
[influxdb] What is the influx query to show measurements newer than 1 day old?
Travis Keep
2018-02-13 19:11:11 UTC
Permalink
show measurements
This shows all the measurements in a database, but I am interested in only
the measurements that are newer than 1 day. If the measurement did not
exist 1 day ago, I don't want it listed. How would one write such a query?
--
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+***@googlegroups.com.
To post to this group, send email to ***@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/67f7273d-bc57-4cc3-83b5-fa6d08f1f6bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Frank Inselbuch
2018-02-22 16:03:25 UTC
Permalink
I don't believe that can be done.
What you can do is query the measurement for a field value with a timestamp
in the last day.
For example

select temp from machines where time > now() - 1d

But you have to specify the measurement in the query.

You could construct these queries for all measurements in a program (bash,
python, etc.) ... run show measurements to get the whole list of
measurements.
Then construct the above query for each measurement.

Not ideal, I know.
Post by Travis Keep
show measurements
This shows all the measurements in a database, but I am interested in only
the measurements that are newer than 1 day. If the measurement did not
exist 1 day ago, I don't want it listed. How would one write such a query?
--
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+***@googlegroups.com.
To post to this group, send email to ***@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/3e902e30-9cb3-4aba-8fa1-f669dcd1e644%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Frank Inselbuch
2018-02-22 16:04:19 UTC
Permalink
Or perhaps better

show last(temp) from machines where time > now() - 1d
Post by Frank Inselbuch
I don't believe that can be done.
What you can do is query the measurement for a field value with a
timestamp in the last day.
For example
select temp from machines where time > now() - 1d
But you have to specify the measurement in the query.
You could construct these queries for all measurements in a program (bash,
python, etc.) ... run show measurements to get the whole list of
measurements.
Then construct the above query for each measurement.
Not ideal, I know.
Post by Travis Keep
show measurements
This shows all the measurements in a database, but I am interested in
only the measurements that are newer than 1 day. If the measurement did
not exist 1 day ago, I don't want it listed. How would one write such a
query?
--
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+***@googlegroups.com.
To post to this group, send email to ***@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/647f44f8-6f0f-4b9a-9019-3b78a5d603ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...