takus / fluent-plugin-ec2-metadata

Fluentd output plugin to add Amazon EC2 metadata into messages
Other
44 stars 28 forks source link

Unable to use tags with either - or : in the tag key #22

Closed kgf closed 7 years ago

kgf commented 7 years ago

I am attempting to use version 0.0.12 of this gem. I installed it and am able to use it successfully for most AWS tag key values. However....

We would like to have our custom tag tracking-id and the AWS standard aws:autoscaling:groupName values brought into fluent. Sadly, instead of getting the value, it is set to ${tagset_aws:autoscaling:groupname}. That is the value is ES. See screenshot below. It seems like the code is getting hung up on the included - and :. I thought it might be in https://github.com/takus/fluent-plugin-ec2-metadata/blob/master/lib/fluent/plugin/ec2_metadata.rb#L147 because I was struggling to parse the regex, but the str seems unchanged after going through the gsub.

A second question, what is the purpose of this line ? Since you are enumerating the pairs, how can that key not be present ? https://github.com/takus/fluent-plugin-ec2-metadata/blob/master/lib/fluent/plugin/ec2_metadata.rb#L18

Thanks for your help, and this useful gem. Kevin

screen shot 2016-11-04 at 4 41 01 pm
eadasiak commented 7 years ago

@kgf - I just ran into this issue myself, trying to include the tag aws:cloudformation:stack-name in my log records. I did a bit of digging, and your suspicion about the gsub was correct. I've submitted a PR that fixed it for me. Hope this helps!

takus commented 7 years ago

Thanks for the suggestion and question!! I'm going to release v0.0.13.