Closed Nick135 closed 1 year ago
Can you run the influx delete
command with --http-debug
and post the results? I think the quoting may be incorrect but that will show the exact payload being sent.
2023/01/23 16:56:39
POST /api/v2/delete?bucket=mybucket&org=myOrg HTTP/1.1
Host: localhost:8086
User-Agent: influx/2.6.0 (windows) Sha/90e825c Date/2022-12-15T18:46:35Z
Transfer-Encoding: chunked
Accept: application/json
Authorization: Token myToken
Content-Type: application/json
Accept-Encoding: gzip
a4
{"predicate":"_measurement=\"SN001:2\" and _field=aeff_RMS and SetpointReached=False","start":"2023-12-22T12:09:30.5932158Z","stop":"2023-01-17T12:09:30.5932158Z"}
0
2023/01/23 16:56:39
HTTP/1.1 204 No Content
Content-Length: 0
Date: Mon, 23 Jan 2023 15:56:39 GMT
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.6.0
If I escape all string Variales with quoting the command also not work.
influx delete --bucket "mybucket" --predicate "_measurement=\"SN001:2\" and _field=\"aeff_RMS\" and SetpointReached=\"False\"" --start "2023-12-22T12:09:30.593215800Z" --stop "2023-01-17T12:09:30.593215800Z" -t myToken -o myOrg --http-debug
2023/01/23 17:09:02
POST /api/v2/delete?bucket=mybucket&org=myOrg HTTP/1.1
Host: localhost:8086
User-Agent: influx/2.6.0 (windows) Sha/90e825c Date/2022-12-15T18:46:35Z
Transfer-Encoding: chunked
Accept: application/json
Authorization: Token myToken
Content-Type: application/json
Accept-Encoding: gzip
ac
{"predicate":"_measurement=\"SN001:2\" and _field=\"aeff_RMS\" and SetpointReached=\"False\"","start":"2023-12-22T12:09:30.5932158Z","stop":"2023-01-17T12:09:30.5932158Z"}
0
2023/01/23 17:09:02
HTTP/1.1 204 No Content
Content-Length: 0
Date: Mon, 23 Jan 2023 16:09:02 GMT
X-Influxdb-Build: OSS
X-Influxdb-Version: v2.6.0
Are you able to share some/all of your data to help reproduce? My initial attempts at replicating are not successful.
If helpfull, I can compact the data and share it. Is the old ftp link still active?
Yes it is, that would work great
Hey @Nick135, sorry for sending you on a bit of wild goose chase here. Due to some implementation specific details, the delete predicates do not support _field
based deletion. I should have caught that earlier when looking at your query. The currently supported way to delete specific points is to use Flux to filter the data into a new bucket from() |> filter(.. filter out the bad field ...) |> to(... new bucket ... )
. I'm going to close this issue, sorry for the confusion and thanks being helpful in debugging.
https://docs.influxdata.com/influxdb/v2.6/write-data/delete-data/# https://github.com/influxdata/docs-v2/issues/3786
@jeffreyssmith2nd: With use of Flux and the to()
command, I have the bad fields in two bucket. As I unterstand the docs and my short test, flux send the queried data to the other bucket, but the data are still present in the source bucket.
Ah you want to do the inverse. You want to send all the good data to the new bucket and switch to that bucket, deleting the old bucket afterwards.
Now I want to delete only certain field values. I don't get an error but the rows are not removed from db.
influx query works:
cmd.exe