Skip to content

Delete Specific Measurements from InfluxDB

Kyle Gabriel edited this page Oct 23, 2019 · 1 revision

Start an influx terminal.

influx

Set the Mycodo database.

use mycodo_db

Search for points, for example, with unit "C", device_id "d1186668-861b-442d-b385-0edf1c7ba5ce", and the value is less than -30.

SELECT * FROM C WHERE device_id='d1186668-861b-442d-b385-0edf1c7ba5ce' AND value < -30

Example output:

time                channel device_id                            measure     value
----                ------- ---------                            -------     -----
1567898971960999936 1       d1186668-861b-442d-b385-0edf1c7ba5ce temperature -99.951171875
1567899152665999872 1       d1186668-861b-442d-b385-0edf1c7ba5ce temperature -99.951171875
1567899171508000000 1       d1186668-861b-442d-b385-0edf1c7ba5ce temperature -99.951171875

Delete measurements with a time of 1570121075285000192 and the unit "C".

DELETE FROM C WHERE time=1570121075285000192