Removing a weird reading from InfluxDB

Bad reading arrived

Sometimes things go wrong and you might find things like these in your database:

$ influx -database umwelt_airrohr -precision rfc3339
> SELECT bme_t, dht_t, p10, p25 FROM research_node_5_sensors ORDER BY time DESC LIMIT 3;

time                 bme_t dht_t p10   p25
----                 ----- ----- ---   ---
2036-02-07T06:28:00Z 21.35 19.8  424.5 361.3
2019-01-18T04:54:00Z 20.61 19.2  413.8 316.9
2019-01-18T04:53:00Z 20.63 19.2  406.4 316.8

Identify reading

To delete this weird reading from the future at 2036-02-07T06:28:00Z, check again for the timestamp in unix epoch

$ influx -database umwelt_airrohr
> SELECT bme_t, dht_t, p10, p25 FROM research_node_5_sensors ORDER BY time DESC LIMIT 3;

time                bme_t dht_t p10   p25
----                ----- ----- ---   ---
2085978480000000000 21.35 19.8  424.5 361.3
1547787300000000000 20.61 19.2  410.1 317.6
1547787240000000000 20.61 19.2  413.8 316.9

Remove reading

and finally delete the erratic record

> DELETE FROM research_node_5_sensors WHERE time=2085978480000000000;
2 Likes