influxdb - Deleting InfluxDB points with no tag
问题描述
I have a few points that I am trying to remove that came from bad data and keep reading that you can't really do it but find it hard to believe you really can't.
They have no tags so I tried to give them tags by overwriting them with a tag, then deleting the tag, but it didn't overwrite and i just deleted the new tagged values.
I have the time so tried to delete with where time = 'x'
but get a 400 from Chronograf, tried again in Influx CLI with DELETE FROM "apps" where time = '2019-05-01T17:45:00Z'
and it runs with no errors, but doesn't actually delete the point.
I understand that because of the way Influx indexes things you can't delete based on fields, but there has to be a way?
Thanks.
解决方案
我还没有在官方 Influxdata 文档中看到关于删除没有标签的系列的明确示例。但是像下面示例中的方法在测试中对我有用 - 它demo
使用空标签丢弃所有测量系列。小心在where
子句中包含所有可能的测量标签名称,否则您也可能会丢失良好的数据。
> drop measurement demo
> select * from demo
> insert demo,tagA=A,tagB=B value=5 123455
> insert demo,tagA=A value=6 123456
> insert demo value=1 123451
> insert demo value=2 123452
> insert demo value=3 123453
> select * from demo
name: demo
time tagA tagB value
---- ---- ---- -----
123451 1
123452 2
123453 3
123455 A B 5
123456 A 6
> drop series from demo where tagA='' and tagB=''
> select * from demo
name: demo
time tagA tagB value
---- ---- ---- -----
123455 A B 5
123456 A 6
推荐阅读
- lua - Corona SDK newSwitch - switch.isOn 与实际状态相反
- r - 找不到对象“pos_density”
- javascript - 关于javascript导入的问题。为什么将这些作为常量导入?
- android - 使用 Android Canvas.drawBitmapMesh 会产生意想不到的位图转换
- javascript - 在 React 中单击两个相同菜单的菜单项时显示相同且仅一个内容
- rust - 将类型注释添加到 `and_then` 时出现“无法在 trait 对象上调用 `and_then` 方法”错误
- javascript - 过滤并将结果映射到新数组中
- javascript - AngularJs - 删除我在 ng-repeat 中点击的卡片
- c# - .NET 核心 2.1。通过 HTTPS 从一个 Docker 容器发布到另一个容器的问题
- arrays - 创建 SQL 查询和 Power-Shell 比较 arrayArray