class Fluent::Plugin::SynerexOutput
Attributes
formatter[RW]
Public Instance Methods
configure(conf)
click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_synerex.rb, line 47 def configure(conf) GRPC.logger.info("Configure start ") super # @lfile = File.open('/tmp/synerex_out.txt',"w+") end
multi_workers_ready?()
click to toggle source
def prefer_buffered_processing
false
end
# File lib/fluent/plugin/out_synerex.rb, line 43 def multi_workers_ready? true end
process(tag, es)
click to toggle source
# File lib/fluent/plugin/out_synerex.rb, line 71 def process(tag, es) # @lfile.puts ( "from process:"+tag.class.to_s+":"+tag.to_s) es.each do |time, record| process_record(tag, time, record) end end
process_record(tag, time, record)
click to toggle source
# File lib/fluent/plugin/out_synerex.rb, line 86 def process_record(tag, time, record) response = send_message(tag, time, record) end
send_message(tag, time, record)
click to toggle source
# File lib/fluent/plugin/out_synerex.rb, line 90 def send_message(tag, time, record) # @lfile.puts ( "tag :"+tag.class.to_s+":"+tag.to_s) # @lfile.puts ("time :"+time.class.to_s+":"+time.to_s) # @lfile.puts ("record:"+record.class.to_s+":"+record.to_s) ts = Google::Protobuf::Timestamp.new(seconds: time) rec = Proto::Fluentd::FluentdRecord.new(tag: tag.to_s, time:ts, record: record.to_s) code = Proto::Fluentd::FluentdRecord.encode(rec) do_notifySupply("Fluentd","tag",code) return nil end
shutdown()
click to toggle source
called befor stop
Calls superclass method
# File lib/fluent/plugin/out_synerex.rb, line 65 def shutdown super end
start()
click to toggle source
called befor start
Calls superclass method
# File lib/fluent/plugin/out_synerex.rb, line 57 def start super nodeserv = @server+":"+@port # @lfile.puts("NodeServer:"+nodeserv) registerServ(nodeserv,"Fluentd-Provider") end
write(chunk)
click to toggle source
# File lib/fluent/plugin/out_synerex.rb, line 78 def write(chunk) # @lfile.puts("from chunk["+chunk.metadata.class.to_s+"]"+chunk.metadata.to_s) tag = chunk.metadata.tag chunk.each do |time, record| process_record(tag, time, record) end end