nokia / fluent-plugin-brevity-control

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

No implicit conversion of Integer to String #2

Closed aarunkushwahaa closed 4 years ago

aarunkushwahaa commented 5 years ago
@type brevity_control interval 15s num 2 attr_keys alarm.id, alarm.severity max_slot_num 100000 stats_msg_fields alarm.key, alarm.id, alarm.name, alarm.data stats_msg_tag company.logging.log all_keys_used true

0 emit transaction failed: error_class=TypeError error="no implicit conversion of Integer into String" location="/opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-brevity-control-0.0.2/lib/fluent/plugin/filter_brevity_control.rb:33:in `+'" tag="syslog.user.notice"

Brevity plugin has following conf

_config_param :attrkeys, :string, default: nil

  | config_param :num, :integer, default: 3   | config_param :max_slot_num, :integer, default: 100000   | config_param :interval, :integer, default: 300   | config_param :stats_msg_tag, :string, default: nil   | _config_param :stats_msgfields, :string, default: nil   | config_param :all_keys_used, :bool, default: true

Is the error i'm receiving because alarm.id is Integer but attr_keys accepts String. If yes, then i need to use to_s function

attr_keys alarm.id.to_s, alarm.severity

But is there way that i change plugin configuartion in such a way that it internally converts any data type to string. I mean like inserting to_s here. @keys = @attr_keys ? @attr_keys.to_s.split(/ , /) : nil

Or is it the plugin problem because the error of "no implicit conversion" i'm getting on all nodes

nanaal commented 5 years ago

It's a bug of plugin brevity_control, I will fix it later. Thanks a lot for your feedback.

nanaal commented 4 years ago

This issue has been fixed in the latest version.