从influxdb删除时,获得无效的RFC3339NANO错误
我是InfruxDB的新手,我想从Postman中删除InfuxDB的一些数据。我正在使用Postman
"data":{
"start": "2021-01-09T12:00:00Z",
"stop": "2021-01-09T12:00:00Z",
"predicate": "_measurement=\"mymesurement\""
}
}
的以下查询,还提供了标题中的授权令牌和内容类型 ,
但是当我执行命令时,它给了我以下错误,
{
"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"
}
但在CLI中也尝试过,但仍会遇到相同的错误。
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'
请帮助我解决这个问题。提前致谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
似乎您需要更新开始和停止字段以遵循RFC3339或RFC3339nano标准,该标准是根据Infruxdb的Golang大会在这里。 That is, RFC3339 = "2021-01-09T12:00:00Z00:00" (4 more digits after the "Z") or RFC3339Nano = "2021-01-09T12:00: 00.000000000Z00:00“ (小数点后和“ Z”之前,还有9位数字,再加上“ Z”之后的4位数字)。
根据。
PS:您最好让停止字段与开始时不同。否则,不会删除任何数据。
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.
当我尝试通过命令行进行操作时,我遇到了相同的错误。
但是在邮递员上,它对我有用。
以下是我的原始请求的示例: -
发布请求
http:// localhost:8086/api/v2/delete?org = mySampleorg& bucket = mySampleBucket
标题
body
headers主体此返回一个空的响应,带有状态代码
204
。要确认我运行选择
查询,发现特定条目已成功删除。I was getting the same error when I tried to do it through command line.
But on Postman it worked for me.
Below is a sample based on my original request:-
POST Request
http://localhost:8086/api/v2/delete?org=MySampleOrg&bucket=MySampleBucket
Headers
Body
This returned an empty response with status code
204
. To confirm I ranselect
query and found that particular entry was deleted successfully.