vmware / fluent-plugin-vmware-loginsight

Fluentd plugin to forward logs to VMware Aria Operations for Logs
Other
10 stars 14 forks source link

If log message has any immutable strings, force_encoding throws errors when trying to change format #5

Closed mohitevishal closed 5 years ago

mohitevishal commented 5 years ago

If any log message or any events/tags has any immutable strings, force_encoding("utf-8") will throw the following error while trying to change the format:

[warn]: #0 force_encoding exception: RuntimeError, 'can't modify frozen String'

Had this issue with modified tag field. This could an issue with any other field in the log.

Solution to his would be to use a copy of immutable string.