2018-02-05 10:04:02 +0530 [warn]: #0 dump an error event: error_class=TypeError error="no implicit conversion of nil into String" location="/opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-elasticsearch-2.4.0/lib/fluent/plugin/out_elasticsearch_dynamic.rb:263:in `sub!'" tag="fluent.info" time=#<Fluent::EventTime:0x00007f118c973a20 @sec=1517805182, @nsec=53991600> record={"worker"=>0, "message"=>"fluentd worker is now running worker=0"}
2018-02-05 10:04:35 +0530 [info]: #0 Connection opened to Elasticsearch cluster => {:host=>"localhost", :port=>9200, :scheme=>"http"}
2018-02-05 10:05:02 +0530 [warn]: #0 dump an error event: error_class=TypeError error="no implicit conversion of nil into String" location="/opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-elasticsearch-2.4.0/lib/fluent/plugin/out_elasticsearch_dynamic.rb:263:in `sub!'" tag="fluent.warn" time=#<Fluent::EventTime:0x00007f118c8e08d8 @sec=1517805242, @nsec=58672400> record={"error"=>"#<TypeError: no implicit conversion of nil into String>", "location"=>"/opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-elasticsearch-2.4.0/lib/fluent/plugin/out_elasticsearch_dynamic.rb:263:in `sub!'", "tag"=>"fluent.info", "time"=>#<Fluent::EventTime:0x00007f118c8e06d0 @sec=1517805182, @nsec=53991600>, "record"=>{"worker"=>0, "message"=>"fluentd worker is now running worker=0"}, "message"=>"dump an error event: error_class=TypeError error=\"no implicit conversion of nil into String\" location=\"/opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-elasticsearch-2.4.0/lib/fluent/plugin/out_elasticsearch_dynamic.rb:263:in `sub!'\" tag=\"fluent.info\" time=#<Fluent::EventTime:0x00007f118c973a20 @sec=1517805182, @nsec=53991600> record={\"worker\"=>0, \"message\"=>\"fluentd worker is now running worker=0\"}"}
2018-02-05 10:05:40 +0530 [warn]: #0 dump an error event: error_class=TypeError error="no implicit conversion of nil into String" location="/opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-elasticsearch-2.4.0/lib/fluent/plugin/out_elasticsearch_dynamic.rb:263:in `sub!'" tag="fluent.info" time=#<Fluent::EventTime:0x00007f118c8c4098 @sec=1517805275, @nsec=81823700> record={"message"=>"Connection opened to Elasticsearch cluster => {:host=>\"localhost\", :port=>9200, :scheme=>\"http\"}"}[root@localhost ~]# td-agent --version
td-agent 1.0.2
[root@localhost ~]#--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to flu...@googlegroups.com.
| require 'fluent/plugin/filter' | |
| module Fluent::Plugin | |
| class BrevityControlFilter < Fluent::Plugin::Filter | |
| Fluent::Plugin.register_filter('brevity_control', self) | |
| config_param :attr_keys, :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_msg_fields, :string, default: nil | |
| config_param :all_keys_used, :bool, default: true | |
| def configure(conf) | |
| super | |
| @keys = @attr_keys ? @attr_keys.split(/ *, */) : nil | |
| @fields = @stats_msg_fields ? @stats_msg_fields.split(/ *, */) : nil | |
| @slots = {} | |
| end | |
| def filter_stream(tag, es) | |
| new_es = Fluent::MultiEventStream.new | |
| es.each do |time, record| | |
| #log.debug "receive record: " + record.to_s | |
| #log.debug "hash : " + @slots.to_s | |
| if @keys | |
| values = @keys.map do |key| | |
| value=key.split(/\./).inject(record) do |r, k| | |
| break unless r.has_key?(k) | |
| r[k] | |
| end | |
| value ? key+"="+value : nil | |
| end |