I have been using InfluxDB for some time now to replace a few RRD databases. Now as the characteristics of a RRD are what I need (keeping data precise in shorter timeframes, but downsample down the line for older data), I decided to use InfluxDB as such.
I have defined retention policies and continuous queries for the downsampling. Everything works as expected, except for some measurements that contain non-numerical data. They represent the status of a system, which can have several distinct strings as values, but only one at a time. The values are correctly in the main database, but not in the downsampled one, which has a different retention policy.
Is it possible to downsample non-numerical data? I wonder what needs to go in the CQ, “mean()” does not really make sense here.
For your reference, here’s one of the continuous queries I use to downsample 1-minute data to 10-minute-data for 7-day storage precision.
SELECT mean() INTO database.“10m_for_7d”.:MEASUREMENT FROM database.“1m_for_24h”././ GROUP BY time(10m), *
The relevant retention policies are:
name duration shardGroupDuration replicaN default
1m_for_24h 24h0m0s 1h0m0s 1 true
10m_for_7d 168h0m0s 24h0m0s 1 false