3.1 KiB
3.1 KiB
title | list_title | description | menu | weight | influxdb/v2.0/tags | related | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Delete data | Delete data | Delete data in the InfluxDB CLI and API. |
|
106 |
|
|
Use the influx
CLI or the InfluxDB API /delete
endpoint to delete data.
{{% note %}}
The influx delete --predicate
flag is currently disabled and will be re-enabled in an upcoming release. Deleting data without a predicate deletes all data in the specified bucket with timestamps between the specified start
and stop
times.
{{% /note %}}
Delete data using the influx CLI
- Use the
influx delete
command to delete points from InfluxDB. - Specify your organization, bucket, and authentication token.
- Define the time range to delete data from with the
--start
and--stop
flags.
Example
influx delete -o my-org -b my-bucket -t $INFLUX_TOKEN \
--start '1970-01-01T00:00:00.00Z' \
--stop '2020-01-01T00:00:00.00Z' \
Delete data using the API
- Use the InfluxDB API
/delete
endpoint to delete points from InfluxDB. - Include your organization and bucket as query parameters in the request URL.
- Use the
Authorization
header to provide your InfluxDB authentication token. - In your request payload, define the time range to delete data from with
start
andstop
.
Example
curl --request POST http://localhost:8086/api/v2/delete/?org=myOrg&bucket=myBucket \
--header 'Authorization: Token <YOURAUTHTOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"start": "1970-01-01T00:00:00.00Z",
"stop": "2020-01-01T00:00:00.00Z"
}'
For more information, see the /delete
API documentation.