influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

[feature request] RENAME TAG

Open beckettsean opened this issue 10 years ago • 49 comments

From https://github.com/influxdb/influxdb/issues/828#issuecomment-83224779

e.g. RENAME TAG foo TO bar ON measurement

Would have to update all CQs, too.

beckettsean avatar Sep 17 '15 21:09 beckettsean

Out of curiosity, what's a CQ?

victorhooi avatar Sep 17 '15 22:09 victorhooi

Continuous query.

otoolep avatar Sep 17 '15 23:09 otoolep

Aha, thanks =).

victorhooi avatar Sep 18 '15 00:09 victorhooi

+1, I love this feature

yujinqiu avatar Sep 19 '15 02:09 yujinqiu

+1

mitar avatar Jan 03 '16 17:01 mitar

What about changing the tag value?

mitar avatar Jan 03 '16 17:01 mitar

:+1:

We need both , tag key change and also tag value change !

Lots of thanks for this awesome tool.

toni-moreno avatar Apr 14 '16 09:04 toni-moreno

+1

sthorsen avatar May 25 '16 09:05 sthorsen

@toni-moreno I have a perfect use case as to why I need to be able to change values. I use collectd to pull in my SNMP values. I performed a firmware upgrade on a line of switches and the ifDesc field name changed on all 8 switches. So now all of the type_instance tag values are different. For example for interface 32 on switch 1 the ifDesc used to be "TenGigabitEthernet 1_0_32" but now that interface is "TenGigabitEthernet 0_32" So the graphs and data retention are broken. Being able to alter/rename/update all tags from before the firmware update would allow the data to be linked up.

kb1ibt avatar Jun 04 '16 21:06 kb1ibt

+1

piaseckim avatar Sep 30 '16 09:09 piaseckim

I have same use case about SNMP values and waiting for long time for this feature. In the meantime, I dump series, rename tag value with sed and import again, but it's very slow process when I have many interfaces changes.

scambra avatar Nov 15 '16 11:11 scambra

+1. I can't find a workaround. I can workaround the measurement and field rename, but not the tag.

Eg. SELECT "old_field_key" AS "new_field_key" INTO new_measurement FROM old_measurement GROUP BY "old_tag_key" renames field key and measurement, but cannot be extended to rename the tag key.

hraftery avatar Dec 22 '16 22:12 hraftery

I'm having the exact same problem as hraftery piecing together data from two databases that contain data about the same measurement but with different names. Another solution would something like

Select sum(value) as value, counter=blub into newmeasurement

so I can tag the new data that going into newmeasurement.

sandervandegeijn avatar Jan 29 '17 00:01 sandervandegeijn

Have anybody found a proper way or a workaround? I am also having the same issue. I renamed a host and now I need to merge the old tagged value of the host with the new one. Is that possible? Thanks George

apollotonkosmo avatar May 08 '17 11:05 apollotonkosmo

same here is there a workaround? In my case the scheme changed, and I need to rename a tag like renaming a column name

mribichich avatar May 12 '17 21:05 mribichich

+1 must have feature

max3163 avatar Jun 09 '17 11:06 max3163

@beckettsean any update on this?

discoduck2x avatar Sep 06 '17 12:09 discoduck2x

+1 (really not seeing how this has not been implemented yet, essential as it seems dealing with historical data)

curio77 avatar Sep 13 '17 15:09 curio77

Any update on this? We have a use case of updating existing tag values as well.

rjain11 avatar Dec 15 '17 19:12 rjain11

How about updating a tag for points matching a query?

In the Key Concepts sample data, imagine that one of the scientists mistakenly recorded the location for measurements between timeA and timeB as 1 instead of 2. How can we update those points? Overwriting with the same (measurement name, time, tag set) tuple can only be used to update fields, not tags.

dandv avatar Jan 03 '18 05:01 dandv

+1

NubeDev avatar Jan 25 '18 21:01 NubeDev

Newbie alert: I'm a little unclear about the scope of this feature request. Does it cover two related but different capabilities?:

  1. Be able to rename a tag key for all series in a measurement. E.g. for Key Concepts sample data, rename "location" -> "place"
  2. Be able to change the a tag value for a one or more series in a measurement. E.g. for Key Concepts sample data, UPDATE census SET "scientist"="perpetua" WHERE "scientist"="miller" (e.g. person changed their last name)

The RENAME TAG foo TO bar ON measurement suggestion from the OP description seems to describe the first situation but not the second.

For our purposes, the second situation, rename a tag value is by far the most important.

Should this issue really be split in two? Is it the same implementation to support both tag key and tag value changes or are the implementations independent? Which is the most difficult to achieve?

pmorch avatar Feb 01 '18 13:02 pmorch

This issue is definitely about the tag key. It's one of a group of issues about renaming keys that used to be one issue.

As dandv and you say, changing tag values is also a challenge, but deserves its own issue because the implications are different. As discussed on StackOverflow and Google Groups, there's no good solution to that either, short of re-inserting all the data and dropping the old. The implication is that tag values form series, so changing a tag value could change the database cardinality. While changing a tag key only affects the metadata.

If you want to go down the dump all, modify, re-import path (brutal, but effective), this comment might help.

hraftery avatar Feb 01 '18 21:02 hraftery

This would be an awesome feature. Right now migrating data when a tag value changes is not really possible.

scotloach avatar Mar 01 '18 22:03 scotloach

+1

MuadDib81 avatar Apr 25 '18 08:04 MuadDib81

+1

yves-bourgeois avatar May 09 '18 08:05 yves-bourgeois

+1 waiting :)

YEMEAC avatar May 09 '18 11:05 YEMEAC

+1

mecton avatar May 11 '18 20:05 mecton

+1

As well as changing the tag value.

galanCA avatar Jul 06 '18 20:07 galanCA

+1

As well as changing the tag value.

nativb avatar Jul 19 '18 08:07 nativb