-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[feature request] Insert new tags to existing values, like update #3904
Comments
+1 |
This feature would require a fairly major architectural change to the database and is not something we will do this year, if ever. Closing the request for now. |
Please consider this during your next architecture review. I think this would be required in many enterprise situations, where you make a mistake while inserting values, and realize it later. Having an option to update would be a life saver! |
Hi,
|
+1 For us events are usually only recognising in the data following a reasoning step after capture. And, we want to tag data with its event once its recognised. I am considering using continuous queries to do some of this tagging after capture but it seems inefficient and I am not sure it will work for all our use cases |
+1 |
+1 |
+1, if you guys aren't going to add this in some time soon could you at least add work around options to the current documentation since there was nothing mentioning appending tags to an existing measurement. |
+1 this is definitely needed in many real-world solutions as architectural changes might need additional tags. |
+1 to add this feature since as of today, there is no other options than to dump a measure in ASCII, hack ASCII file and send it back to a new measure via wireprotocol. |
For now, I updated my InfluxDB Fetcher tool (https://github.com/hgomez/influxdb) to transform fields in tags so I could reimport them in proper format |
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1 please provide ability to update existing tags |
+1 |
@beckettsean Hi Sean, since closing this request quite few folks have expressed their interest and support for this feature. Do you guys want to reconsider this request? |
Additional use-cases:
|
+1 |
Issue #828 concerns renaming databases, measurements, fields and tags. Some of that functionality is provided by Given those limitations, it may be better to dump data, convert to line protocol, go nuts with sed to change/add keys, and then POST back. @hgomez-sonarsource 's excellent InfluxDB Fetcher makes this quite quick and easy, but note:
So you can do a simultaneous database rename, measurement rename, field rename, tag rename and tag addition with three chunky lines:
I used something very similar to convert 20000 points in a couple of seconds. YMMV. |
+1 |
Just came across a possible improvement on my workaround posted above. Haven't investigated it, but |
@hraftery Nice, but you can only use it on database level, not measurement level. Output will get very big, very soon, and I didn't manage to have it output to stdout (i.e. pipe.). Of course you can work around that with mkfifo etc. but still big output... Of course you can add to the workaround by first "select"ing "into" a new db and so on 😁 |
+1 this will be really useful feature |
+1, this will be really useful feature while refact app |
+1 : this could also be accomplished if |
+1 |
+1 to allow tagging measurements with post processed tags. |
+1 |
@beckettsean Can this be reconsidered at this point? Its been two years since the thread was closed, and it might be more feasible architecturally to consider this now! This will be extremely useful for maintaining data in medium to long term in an enterprise setting. |
+1 Update:
from influxdb import InfluxDBClient
client = InfluxDBClient('localhost', database='network')
db_data = client.query('select tx_bps, rx_bps from downsampled_traffic')
data_to_write = [
{
'measurement': 'intermediate',
'tags': {'host': 'compass', 'if': 'eth0'},
'time': d['time'],
'fields': {'tx_bps': float(d['tx_bps']), 'rx_bps': float(d['rx_bps'])}
}
for d in db_data.get_points()
]
client.write_points(data_to_write)
|
+9000 |
+1 |
Encountered this issue on a production system. We have around a million entries every day, the current dataset has been accumulating for half a year. Work has been started on a simple utility to convert fields to tags in the wire protocol representation. go get -u github.com/rvolosatovs/influx-taggify Example usage: influx_inspect export -database "$db" -datadir "$datadir" -waldir "$waldir" -out /tmp/influx-export
# Delete the measurements you don't need to convert using `sed`/`perl` (i.e. `perl -in -e 'print unless m/^unrelated_measurement.*/' /tmp/influx-export`)
influx-taggify -in /tmp/influx-export -out /tmp/influx-export-tagged fieldFoo fieldBar
# Drop the old database or edit generated file to change the name of the database
influx -import -path /tmp/influx-export-tagged It worked for my use case, but your mileage may vary. |
+1 @2018 |
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
For what it's worth I've revisited this 2 years later and explored all alternative options for exporting/importing data. To save others the hours of frustration, it seems my workaround above is still the easiest way to achieve this and all manner of related export/import tasks. Lesser alternatives:
|
We were trying to solve this problem for a customer - where data may have been inserted incorrectly and we then needed to go back and re-tag a series (or several series). We ended up creating a little node-based migration service. It's solving our problem for now, and our customer has a more friendly means of managing their data. May not be suitable for all cases. You can find it here. |
this would be nice in example: we have a few lab room and we use a CQ to find how busy each room is... The rooms are not tagged but are inferred from the host name.
something like the following would would be a nice improvement!
|
@hraftery please reconsider this feature request. |
@steverweber I'm just a user - you probably want to direct your request to a contributor. But I wouldn't hold your breath. This issue was closed back in 2015. There are at least three workarounds described in this thread, but I agree, something along the lines of a |
I sincerely with that this would be reconsidered. It's a must-have :) |
Are there any plans to implement this feature in influxdb 2.0? |
+1 |
Hi there, following up on the comment by @hraftery at #3904 (comment), everything about @hgomez' excellent InfluxDB Fetcher still holds true, but we just improved the convenience of installation. You don't have to build it yourself from now on but instead you can conveniently download a ready-made With kind regards, |
Can we have a query syntax which allows to insert/attach a new set of tags (along with exiting ones) to values/rows that are already part of a measurement?
My use case: I created a measurement from PerfMon log, which already has Host= tag. Now I want to categorize the data by applications, so I want to add tags like "App1=, App2=" assuming I can have two apps hosted on same server.
Then I want to be able to say
Update <measurement name> add <tag name=value> where <some condition based on tags>
The text was updated successfully, but these errors were encountered: