class Fluent::BaritoBatchVMOutput
Constants
- PLUGIN_NAME
Public Instance Methods
format(tag, time, record)
click to toggle source
Overide from BufferedOutput
# File lib/fluent/plugin/out_barito_batch_vm.rb, line 24 def format(tag, time, record) [tag, time, record].to_msgpack end
start()
click to toggle source
Overide from BufferedOutput
Calls superclass method
# File lib/fluent/plugin/out_barito_batch_vm.rb, line 19 def start super end
write(chunk)
click to toggle source
Overide from BufferedOutput
# File lib/fluent/plugin/out_barito_batch_vm.rb, line 29 def write(chunk) data = { 'items' => [] } transport = Fluent::Plugin::BaritoTransport.new(@produce_url, log) chunk.msgpack_each do |tag, time, record| trail = Fluent::Plugin::ClientTrail.new(false) timber = Fluent::Plugin::TimberFactory::create_timber(tag, time, record, trail) data['items'] << timber end if @application_secret.nil? or @application_secret.empty? return if @application_group_secret.nil? or @application_name.nil? header = { content_type: :json, 'X-App-Group-Secret' => @application_group_secret, 'X-App-Name' => @application_name } else header = {content_type: :json, 'X-App-Secret' => @application_secret} end transport.send(data, header) end