Delete data from the bucket

I cannot delete data from the bucket. I use the instructions https://docs.influxdata.com/influxdb/v2.0/write-data/delete-data/.
Error: unknown shorthand flag: ‘b’ in -b,
The output of the “influx delete -h” command does not contain the -b ???
Flags:
-c, --active-config string Config name to use for command; Maps to env var $INFLUX_ACTIVE_CONFIG
–bucket string The name of destination bucket; Maps to env var $INFLUX_BUCKET_NAME
–bucket-id string The ID of the destination bucket; Maps to env var $INFLUX_BUCKET_ID
–configs-path string Path to the influx CLI configurations; Maps to env var $INFLUX_CONFIGS_PATH (default “/root/.influxdbv2/configs”)
-h, --help Help for the delete command
–host string HTTP address of InfluxDB; Maps to env var $INFLUX_HOST
-o, --org string The name of the organization that owns the bucket; Maps to env var $INFLUX_ORG
–org-id string The ID of the organization that owns the bucket; Maps to env var $INFLUX_ORG_ID
-p, --predicate string sql like predicate string, exp ‘tag1=“v1” and (tag2=123)’
–skip-verify Skip TLS certificate chain and host name verification.
–start string the start time in RFC3339Nano format, exp 2009-01-02T23:00:00Z
–stop string the stop time in RFC3339Nano format, exp 2009-01-02T23:00:00Z
-t, --token string Authentication token; Maps to env var $INFLUX_TOKEN

Hello @vshaev,
Can you please share your entire command?
Looking at the API documentation indicates that a bucket is needed. However, can you try using -bucket and -bucket-id?

Thank you

I am trying to use CLI - “influx delete --org myOrg --bucket mybucket --start ‘1970-01-01T00:00:00.00Z’ --stop ‘2020-01-01T00:00:00.00Z’ --token myToken”
Error: Failed to delete data: Not implemented.

@vshaev,
Is your token an all access token?

Hi @vshaev, the API used by that CLI command isn’t supported yet. We just merged the implementation, it’ll be included in the 2.0.3 release.

2 Likes

Running 2.0.3 database and CLI.

I am having exactly the same problem being described. My CLI influx delete command is very similar, but I am using the predicate ‘_field=“outdoor” AND _measurement=“temperature”’.

Has the fix described truly built into 2.0.3 and are there still issues with the predicate?

Thanks

Hi @dcaho, delete-with-predicate was shipped with v2.0.3, but we recently discovered that using _field within the predicates doesn’t work. You can track progress towards the fix on this issue: InfluxDB delete with predicate works for _measurement, but not for specific _field · Issue #20399 · influxdata/influxdb · GitHub