I’m trying to downsample all my data (in a specific database) with a continuous query including back-referencing as explained in https://docs.influxdata.com/influxdb/v1.7/query_language/continuous_queries/ . However, it does’nt work, because the regular expression /.*/
in the FROM clause seems to not find most measurements.
cq_oneyear CREATE CONTINUOUS QUERY cq_oneyear ON openhab_db BEGIN SELECT mean(*), min(*), max(*) INTO openhab_d
b.oneyear.:MEASUREMENT FROM openhab_db.sevendays./.*/ GROUP BY time(15m), * END
So, first question: Am I right that /.*/ should match ALL measurements in openhab_db.sevendays
?
So, to play around, I’m using this query on CLI:
> SELECT mean(*), min(*), max(*) INTO openhab_db.oneyear.:MEASUREMENT FROM openhab_db.sevendays./.*/ WHERE time>=now
() - 6h GROUP BY time(5m), *
name: result
time written
---- -------
0 0
Then without any INTO clause - and LAST as aggregator:
SELECT LAST(*) FROM openhab_db.sevendays./a.*/ WHERE time >= '2020-04-04T21:30:00Z' AND time < '2020-04-04T21:55:0
0Z' GROUP BY time(60m)
→ some measurements are shown:
name: aldoni_thled_State
time last_value
---- ----------
1586034000000000000 lost
name: hzgctrl_State
time last_value
---- ----------
1586034000000000000 ready
name: ian_tray_State
time last_value
---- ----------
1586034000000000000 ready
[... some few more ..]
Then, I changed the regex to /a.*/
- from my understanding of regular expressions this should match all measurements starting with a.
However - it shows now more measurements - maybe all containing an a?:
The matched measurements now can be aggregated with MEAN, MIN, or MAX, so I use them for my example query (with LAST as aggregator it also shows the text states):
> SELECT MEAN(*),MAX(*),MIN(*) FROM openhab_db.sevendays./a.*/ WHERE time >= '2020-04-04T21:30:00Z' AND time < '2020
-04-04T21:55:00Z' GROUP BY time(60m)
name: Balkon_dewPoint
time mean_value max_value min_value
---- ---------- --------- ---------
1586034000000000000 0.9583999999999999 1.18 0.63
name: Balkon_humidity
time mean_value max_value min_value
---- ---------- --------- ---------
1586034000000000000 47.565599999999996 48.96 46.63
name: Balkon_pressure
time mean_value max_value min_value
---- ---------- --------- ---------
1586034000000000000 1027.282 1027.43 1027.2
name: Balkon_temperature
time mean_value max_value min_value
---- ---------- --------- ---------
1586034000000000000 11.719999999999995 11.97 11.53
[...many more ...]
What I’m doing wrong?
I’m using continuous queries with wildcards and back-referencing on another server without problems?