docs-v2/content/influxdb/v2.0/write-data/delete-data.md

90 lines
3.1 KiB
Markdown
Raw Normal View History

2020-10-12 17:46:10 +00:00
---
title: Delete data
list_title: Delete data
description: >
Delete data in the InfluxDB CLI and API.
menu:
influxdb_2_0:
2020-10-12 17:46:10 +00:00
name: Delete data
parent: Write data
weight: 106
influxdb/v2.0/tags: [delete]
2020-10-12 17:46:10 +00:00
related:
2020-10-12 21:52:56 +00:00
- /influxdb/v2.0/reference/syntax/delete-predicate/
- /influxdb/v2.0/reference/cli/influx/delete/
2020-10-12 17:46:10 +00:00
---
<!--
## Delete data in the InfluxDB UI
Delete data from buckets you've created. You cannot delete data from system buckets.
### Delete data from buckets
1. Click **Load Data** in the navigation bar.
{{< nav-icon "load data" >}}
2. Select **Buckets**.
3. Next to the bucket with data you want to delete, click **Delete Data by Filter**.
4. In the **Delete Data** window that appears:
- Select a **Target Bucket** to delete data from.
- Enter a **Time Range** to delete data from.
- Click **+ Add Filter** to filter by tag key and value pair.
- Select **I understand that this cannot be undone**.
5. Click **Confirm Delete** to delete the selected data.
### Delete data from the Data Explorer
1. Click the **Data Explorer** icon in the sidebar.
{{< nav-icon "data-explorer" >}}
2. Click **Delete Data** in the top navigation bar.
3. In the **Delete Data** window that appears:
- Select a **Target Bucket** to delete data from.
- Enter a **Time Range** to delete data from.
- Click **+ Add Filter** to filter by tag key-value pairs.
- Select **I understand that this cannot be undone**.
4. Click **Confirm Delete** to delete the selected data.
!-->
2.0 GA and separate Cloud from OSS (#1805) * WIP separate cloud docs, duplicate content shortcode * WIP cloud-separation * WIP separate cloud * duplicated oss into cloud and am making updates * moved cloud updates to cloud * reimplemented duplicate-oss shortcode * separate Cloud and OSS content in Tools & integ... * Split OSS and Cloud content for Security & auth * Split OSS and Cloud content for Manage org * Split OSS and Cloud - Manage Orgs add'l updates * various updates, primarily in oss and cloud reference * split content for notification endpoints * Move InfluxQL doc to Cloud - Remove the "Query with InfluxQL" page from OSS docs - Re-incorporate changes made in https://github.com/influxdata/docs-v2/pull/1506 * removed product tags from nav and articles * WIP separate cloud docs, duplicate content shortcode * WIP cloud-separation * WIP separate cloud * duplicated oss into cloud and am making updates * moved cloud updates to cloud * reimplemented duplicate-oss shortcode * separate Cloud and OSS content in Tools & integ... * Split OSS and Cloud content for Security & auth * Split OSS and Cloud content for Manage org * Split OSS and Cloud - Manage Orgs add'l updates * various updates, primarily in oss and cloud reference * split content for notification endpoints * Move InfluxQL doc to Cloud - Remove the "Query with InfluxQL" page from OSS docs - Re-incorporate changes made in https://github.com/influxdata/docs-v2/pull/1506 * removed product tags from nav and articles * New URL switcher (#1720) * restructured url modal * rearchitected the url switcher functionality * add influxdb preference management to url switcher * create separate pages for querying data * update weight * Update flux-repl.md * Update influx-query.md * edits f Scott * move content from explore-metrics to data-explorer * edits; delete explore-metrics * edits * delete file * remove duplicate content * add InfluxQLquery examples * Remove references to "security script" * draft updates for Band Plot vis * WIP separate cloud docs, duplicate content shortcode * WIP cloud-separation * WIP separate cloud * duplicated oss into cloud and am making updates * moved cloud updates to cloud * reimplemented duplicate-oss shortcode * separate Cloud and OSS content in Tools & integ... * Split OSS and Cloud content for Security & auth * Split OSS and Cloud content for Manage org * Split OSS and Cloud - Manage Orgs add'l updates * various updates, primarily in oss and cloud reference * split content for notification endpoints * Move InfluxQL doc to Cloud - Remove the "Query with InfluxQL" page from OSS docs - Re-incorporate changes made in https://github.com/influxdata/docs-v2/pull/1506 * removed product tags from nav and articles * WIP separate cloud docs, duplicate content shortcode * WIP cloud-separation * WIP separate cloud * duplicated oss into cloud and am making updates * moved cloud updates to cloud * reimplemented duplicate-oss shortcode * separate Cloud and OSS content in Tools & integ... * Split OSS and Cloud content for Manage org * Split OSS and Cloud - Manage Orgs add'l updates * various updates, primarily in oss and cloud reference * split content for notification endpoints * Move InfluxQL doc to Cloud - Remove the "Query with InfluxQL" page from OSS docs - Re-incorporate changes made in https://github.com/influxdata/docs-v2/pull/1506 * New URL switcher (#1720) * restructured url modal * rearchitected the url switcher functionality * add influxdb preference management to url switcher * URL validation on custom URL (#1763) * added url validation to custom url form, resolves #1739 * removed placeholder message from custom url form * updated styles for url selector modal * Move restore command to `influx` cli, update flags * Update table for backup * Remove RC information, update paths for restore, change `backup-path` flag to `input` * WIP separate cloud docs, duplicate content shortcode * WIP cloud-separation * WIP separate cloud * duplicated oss into cloud and am making updates * moved cloud updates to cloud * reimplemented duplicate-oss shortcode * separate Cloud and OSS content in Tools & integ... * Split OSS and Cloud content for Security & auth * Split OSS and Cloud content for Manage org * Split OSS and Cloud - Manage Orgs add'l updates * various updates, primarily in oss and cloud reference * split content for notification endpoints * Move InfluxQL doc to Cloud - Remove the "Query with InfluxQL" page from OSS docs - Re-incorporate changes made in https://github.com/influxdata/docs-v2/pull/1506 * removed product tags from nav and articles * WIP separate cloud docs, duplicate content shortcode * WIP cloud-separation * WIP separate cloud * duplicated oss into cloud and am making updates * moved cloud updates to cloud * reimplemented duplicate-oss shortcode * separate Cloud and OSS content in Tools & integ... * Split OSS and Cloud content for Manage org * Split OSS and Cloud - Manage Orgs add'l updates * various updates, primarily in oss and cloud reference * Move InfluxQL doc to Cloud - Remove the "Query with InfluxQL" page from OSS docs - Re-incorporate changes made in https://github.com/influxdata/docs-v2/pull/1506 * New URL switcher (#1720) * restructured url modal * rearchitected the url switcher functionality * add influxdb preference management to url switcher * WIP separate cloud docs, duplicate content shortcode * WIP cloud-separation * WIP separate cloud * duplicated oss into cloud and am making updates * moved cloud updates to cloud * reimplemented duplicate-oss shortcode * Split OSS and Cloud content for Manage org * Split OSS and Cloud - Manage Orgs add'l updates * various updates, primarily in oss and cloud reference * Move InfluxQL doc to Cloud - Remove the "Query with InfluxQL" page from OSS docs - Re-incorporate changes made in https://github.com/influxdata/docs-v2/pull/1506 * WIP separate cloud docs, duplicate content shortcode * WIP cloud-separation * WIP separate cloud * duplicated oss into cloud and am making updates * moved cloud updates to cloud * reimplemented duplicate-oss shortcode * separate Cloud and OSS content in Tools & integ... * Split OSS and Cloud content for Manage org * Split OSS and Cloud - Manage Orgs add'l updates * various updates, primarily in oss and cloud reference * Move InfluxQL doc to Cloud - Remove the "Query with InfluxQL" page from OSS docs - Re-incorporate changes made in https://github.com/influxdata/docs-v2/pull/1506 * URL validation on custom URL (#1763) * added url validation to custom url form, resolves #1739 * removed placeholder message from custom url form * updated styles for url selector modal * WIP updating InfluxDB OSS naming throughout * updated canonical shortcode for oss vs cloud, updated 2.0 version numbers on homepage * updated swagger file to rc4 for 2.0 and cloud * fixed canonical partial * Update multi-user Cloud docs Also adds a heading the note on permissions. Closes #1764 * Fix table for backup flags * Update input flag, remove TSI references * Address PR feedback * Remove product tag * Fix DBRP mapping examples (#1776) * updated dbrp mapping examples in influxql query guide, closes #1774 * removed unnecessarily escaped newline from dbrp mapping example * add draft rc4 and GA RNs * cloud and oss name updates * emphasis production ready * update curl example * duplicate oss pages in cloud * Address PR feedback * added new aws us east region, resolves #1777 (#1782) * Add steps for script editor * Add cloud version * moved and updated upgrade guides (#1783) * Fix typos * update upgrade links * edits * Clarify 1m cardinality is initial limit only * fix typo * fix date * Add note on `_internal` database to v1-to-v2 upgrade guide Closes #1775. * Update influxdb.md * fixed broken links throughout cloud docs * fixed broken links in 2.0 oss * Address PR feedback * remove window pushdowns * updated oss pushdown list * Add instructions for verifying InfluxDB 2.0 download * updated latest versions in edge.js * added flux-0.94.0 to flux release notes (#1790) * update date and add Flux .94.0 link * delete broken link to image * remove auto refresh; not currently in UI * add duplicate-oss tag to Cloud execute-queries * highlight diff between Flux and InfluxQL example * delete extra header * Generate v1 compatibility API docs (#1789) * updated swagger generation to generate v1 compat api docs * restructured api docs * updated restore flags table * updated infludb binary urls in oss and cloud * Address PR feedback * Make contact support a mailto link * Add --log-level flag to `influxd upgrade` Closes #1795 * add release note about api/v2/delete * update delete data note for 2.0 * edit * Fix URLs and filenames in OSS 2.0 Get Started * update version for GA * Add color to Flux example for Flux documentation (addresses #1724 ) * Change versions to 2.0.1 in GS * Replace 2.0.0 with 2.0.1 * Revert Docker updates to 2.0.0 * Add release notes for 2.0.0 * edits; add known issue * clarify DB is 1.x * updated influxdb versions in cloud and oss getting started * updated influxdb oss urls doc * remove rc and upd upgrade link in back up data * Edit `influxd upgrade` docs (#1798) * Edit `influxd upgrade` guide Major revision of existing docs. Add "Before you begin: important considerations" section. * Address PR feedback * Edit backup instructions * More work on kap * Rm comment * Rm sentence * Add note on Docker * Edit intro * Edit link * Work on PR feedback * Continue PR feedback * More PR feedback * More edits * more edits * Edits * more edits * rm word * updates to address PR feedback for the upgrade guide Co-authored-by: pierwill <pierwill@users.noreply.github.com> Co-authored-by: Scott Anderson <scott@influxdata.com> Co-authored-by: Kelly <kelly@influxdata.com> Co-authored-by: pierwill <pierwill@users.noreply.github.com> Co-authored-by: pierwill <19642016+pierwill@users.noreply.github.com> Co-authored-by: kelseiv <47797004+kelseiv@users.noreply.github.com> Co-authored-by: noramullen1 <42354779+noramullen1@users.noreply.github.com>
2020-11-11 16:52:14 +00:00
Use the `influx` CLI or the InfluxDB API [`/delete`](/influxdb/v2.0/api/#/paths/~1delete/post) endpoint to delete data.
2020-10-12 21:25:48 +00:00
{{% note %}}
2020-11-18 20:15:01 +00:00
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.
2020-10-12 21:25:48 +00:00
{{% /note %}}
2020-10-12 17:46:10 +00:00
## Delete data using the influx CLI
2020-10-12 21:25:48 +00:00
1. Use the [`influx delete` command](/influxdb/v2.0/reference/cli/influx/delete/) to delete points from InfluxDB.
2020-10-12 17:46:10 +00:00
2. Specify your organization, bucket, and authentication token.
3. Define the time range to delete data from with the `--start` and `--stop` flags.
2020-10-13 00:31:58 +00:00
2020-11-18 20:15:01 +00:00
#### Example
2020-10-13 00:31:58 +00:00
```sh
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' \
2020-10-12 17:46:10 +00:00
```
## Delete data using the API
2020-10-13 00:31:58 +00:00
2020-10-12 17:46:10 +00:00
1. Use the InfluxDB API `/delete` endpoint to delete points from InfluxDB.
2. Include your organization and bucket as query parameters in the request URL.
3. Use the `Authorization` header to provide your InfluxDB authentication token.
4. In your request payload, define the time range to delete data from with `start` and `stop`.
2020-11-18 20:15:01 +00:00
#### Example
2020-10-13 00:31:58 +00:00
```sh
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"
}'
2020-10-13 00:31:58 +00:00
```
_For more information, see the [`/delete` API documentation](/influxdb/v2.0/api/#/paths/~1delete/post)._