emsearcy / fluent-plugin-gelf

Buffered fluentd output plugin to GELF (Graylog2)
Apache License 2.0
33 stars 57 forks source link

Fixed implicit conversion from symbol to string #9

Closed wmotti closed 7 years ago

wmotti commented 9 years ago

Hi, when key is a string, '_'+k breaks with a "no implicit conversion of Symbol into String" error

emsearcy commented 8 years ago

Thanks for the gemspec and utf8 fixes and sorry for not reviewing sooner! Can you summarize for me if you think tech angel's force_encoding is better than #12's kconv toutf8 conversion? That looks fairly straightforward to me, and since the GELF spec expects utf8 strings, it seems better than set_encoding.

I think #15 has a more exhaustive fix on implicit string/symbol behavior, though I asked them to make some changes to their auto conversion of logstash to GELF field mapping so I haven't merged it yet.

emsearcy commented 8 years ago

(reference issue #2 – encoding issues) I've been looking into this more. It looks like in_tail has an undocumented option to force encoding that acts very similar to this, except it happens when the data is read in to fluentd. With this in mind, I think the proposed input_encoding param here is probably a dupe of the encoding param for in_tail.

Moreover, GELF protocol states that the data needs to be utf8, so if we do fix on the GELF output, I think it should be an auto conversion to utf8, not a parameter.

emsearcy commented 7 years ago

I've cherry-picked 3c6eba0 onto master.