Example Query to monitor incoming data regardless of Measurement

I’m looking for an example query to show the last record (timestamp) that came in from all measurements, regardless of the tags associated with it.

Example of what I’m looking for:

select last([timestamp]), [measurement], [id_tag_for_relevant_equip] 
from (select [measurements] where [measurement] not in ('_internal', 'telegraf'))
group by [measurement], [id_tag_for_relevant_equip] ;

This is merely to check and verify that the services is sending through data - the measurements however is random based on the equipment being monitored.

@Marius From the InfluxDB 1 tag on the post, I assume you’re using InfluxDB v1. With InfluxQL, you have to specify 1 or more measurements to query, but it doesn’t support a wildcard (*) for the measurement name. However, you can use a regular expression.

!!! IMPORTANT !!!: I want to be clear that this type of query can be very “dangerous” and can very easily kill your database. If you don’t put some kind of time limit in the WHERE clause, the query will cause InfluxDB to open and read all data from every single shard for every single database stored in your InfluxDB instance. No bueno…

With the above warning in mind, this is how you’d do it:

SELECT * FROM /.*/ WHERE time >= now() - 1d
1 Like