Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop/delete measurements with specified tag keys, not tag values #8604

Closed
Punkoivan opened this issue Jul 18, 2017 · 9 comments
Closed

Drop/delete measurements with specified tag keys, not tag values #8604

Punkoivan opened this issue Jul 18, 2017 · 9 comments
Labels
1.x area/influxql Issues related to InfluxQL query language kind/feature-request wontfix

Comments

@Punkoivan
Copy link

Feature Request

Due to problems with network our data have been corrupted - some issue with telegraf
And we have a lot of these corrupted measurements in influxdb, for example:

diqk
diqkio
disi
disiio
disk
diskim
diskio
diskio.host=hostname.com
diskio.host=hostname.com
dksk
dkskio

and if execute
show series
also a lot of corrupted data, one series as example:
xml,hostnamg=hostname.com,jost=hostname.com
As you can see there are "hostnamg" and "jost" tag keys instead of hostname and host respectively.
and in my case I have ~2k of bogus series (impossible to clean up manually)
system info:

[username@hostname ~]$ influx --version
InfluxDB shell version: 1.2.4
[username@hostname ~]$ cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core)

Proposal:
Admin should be able to run something like this:
drop series with tag keys = "tag_key"
Even w/o regexp support it will be great.

Current behavior:
Currently we have instrument to dropping series only by tag value, not keys
DROP SERIES FROM <measurement_name[,measurement_name]> WHERE <tag_key>='<tag_value>'

Use case:
It's really useful when we need to clean up corrupted/old/wrong from the DB

If I can do this with existing instrument (CLI commands) please point me to the docs, because I didn't find in official docs.

Thanks,

Ivan Pun'ko

@mark-rushakoff
Copy link
Contributor

I'll leave this issue open as a feature request, but one workaround is to use tag key not equal to empty string:

> insert m,host=a n=1i
> insert m,host=b n=1i
> insert m,jost=abc n=5i
> insert m,hhost=def n=5i
> show series
key
m,hhost=def
m,host=a
m,host=b
m,jost=abc

> drop series from m where jost != ''
> show series
key
m,hhost=def
m,host=a
m,host=b

> drop series from m where hhost != ''
> show series
key
m,host=a
m,host=b

@mark-rushakoff mark-rushakoff added area/influxql Issues related to InfluxQL query language kind/feature-request labels Jul 18, 2017
@Punkoivan
Copy link
Author

Thanks, @mark-rushakoff for workaround and hope that we can see this feature in some of the next releases, if someone else interesting in.

Ivan

@dali20022
Copy link

Yes It's very useful for us
Is this feature is included in some release please ?

@Punkoivan
Copy link
Author

Hello @dali20022 , I believe no.
@mark-rushakoff , is there any plan for this?

@mark-rushakoff
Copy link
Contributor

I'm not aware of any immediate plans. Possibly this is something we're addressing with Flux for 2.0.

Ping @timhallinflux?

@dgnorton dgnorton added the 1.x label Jan 7, 2019
@stale
Copy link

stale bot commented Jul 24, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 24, 2019
@dali20022
Copy link

After upgrade to version 1.7 in sandbox environment the problem is fixed
we waiting to confirm that in production

@stale stale bot removed the wontfix label Jul 27, 2019
@stale
Copy link

stale bot commented Oct 25, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 25, 2019
@stale
Copy link

stale bot commented Nov 1, 2019

This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.

@stale stale bot closed this as completed Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x area/influxql Issues related to InfluxQL query language kind/feature-request wontfix
Projects
None yet
Development

No branches or pull requests

4 participants