How to delete a measurement from InfluxDB 2.x
Introduction
Deleting measurements with test data for example is not very complicated. You can do this with the InfluxDB v2 API or with the Influx CLI within the shell of the InfluxDB 2.x Docker container. Both options are described below.
How To
Remove measurement with InfluxDB v2 API
The InfluxDB v2 API makes it very easy to remove a measurement with cURL. And of course it is also possible to use tools like [[Node-RED - Access the InfluxDB API Using the HTTP Request Node|Node-RED]] or Pentaho to make an HTTP call to the API.
Run the following command:
Instructions:
- Required Replace
<ip>
and<port>
with the IP address and port of InfluxDB. Usually port8086
is used but my container is using port3004
- Required Replace
<organization>
with your own organization name. I used the name of my virtual machine for example - Required Replace
<bucket>
with your own bucket name. Because data of Home Assistant is stored I usedhomeassistant
- Required Replace
<token>
with your own token - Required Replace
<measurement>
with the name of the measurement you want to delete
Remove measurement with Influx CLI
Another method to remove a measurement is via the shell of the InfluxDB container using the influx CLI.
Run the following commands:
Instructions:
- Optional Replace
docker
withpodman
if needed - Required Replace
<bucket>
with your own bucket name. Because data of Home Assistant is stored I usedhomeassistant
- Required Replace
<organization>
with your own organization name. I used the name of my virtual machine for example - Required Replace
<measurement>
with the name of the measurement you want to delete - Required Replace
<token>
with your own token
No comments found for this note.
Join the discussion for this note on Github. Comments appear on this page instantly.