0

i am new in influxDB, i want to delete some data from influxDB from postman. I am using below query from postman

"data":{    
    "start": "2021-01-09T12:00:00Z",
    "stop": "2021-01-09T12:00:00Z",
    "predicate": "_measurement=\"mymesurement\""
  }
  }

Also provided the Authorization token and content-type in the header

But when i executed the command it is giving me below error

{
    "code": "invalid",
    "message": "invalid request; error parsing request json: invalid RFC3339Nano for field start, please format your time with RFC3339Nano format, example: 2009-01-02T23:00:00Z"
}

Also tried in CLI but still getting the same error.

influx delete 
 --bucket 'mybucket'\
 --org 'myorg' \
 --token 'mytoken'
 --start '2009-01-02T00:00:00.001Z' \
 --stop '2009-01-02TT00:00:00.001Z' \
 --predicate '_measurement=mymesurement'

Kindly help me to resolve the issue. Thanks in advance

Sumit Paul
  • 189
  • 1
  • 2
  • 10

1 Answers1

0

It seems that you need to update both start and stop field to follow either RFC3339 or RFC3339Nano standard according to InfluxDB's Golang convention here. That is, RFC3339 = "2021-01-09T12:00:00Z00:00" (4 more digits after the "Z") or RFC3339Nano = "2021-01-09T12:00:00.000000000Z00:00" (9 more digits after the decimal point and before the "Z", plus 4 more digits after the "Z") .

InfluxDB support both format according to its original code and its docs.

P.S.: You'd better make the stop field different from the start one. Otherwise, there won't be any data deleted.

Munin
  • 1,576
  • 2
  • 19