How to delete data from influxdb2 with node red

Hi all, I’m trying to delete records from a influxdb and I can’t find anything about this anywhere. I have found some possibilities using the http API but I have no idea how to implement this in Node Red.
Any help would be greatly appreciated.

Is this a one off requirement or do you need to do it regularly?

If you copy the data into a new table using WHERE to filter out the unwanted data, you can then delete the original table and rename the new table to the old table name.

Ii have a mapping application on which I plot sensors. After some time the sensors die and I need to remove them from the map. So yes it’s regularly I would need that functionality. I also could have a status change from good to bad and then don’t list them any more but it would be nice if I can delete them. There also maybe user error inputs which would be nice to delete the records.

Do you know about the Retention Policy feature of influx which allows you to say that data should be deleted after it is a certain age? If you are not interested in data from more than a certain time ago you can use that.

Alternatively you can do it from the command line or using the api. Delete data | InfluxDB OSS v2 Documentation

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.