首页 > 解决方案 > 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.

标签: influxdb

解决方案


我还没有在官方 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

推荐阅读