Sha256: 6c22c4a78cc7bf7f1ca62097553f5a878a3a098c06788a7c45aefafc2c726835

Contents?: true

Size: 596 Bytes

Versions: 2

Compression:

Stored size: 596 Bytes

Contents

module Fluent
  class MqttOutput < Output
    require 'fluent/plugin/mqtt_output_mixin'
    include Fluent::MqttOutputMixin

    # First, register the plugin. NAME is the name of this plugin
    # and identifies the plugin in the configuration file.
    Fluent::Plugin.register_output('mqtt', self)

    def emit(tag, es, chain)
      es.each {|time,record|
        $log.debug "#{tag}, #{format_time(time)}, #{add_send_time(record)}"
        @client.publish(rewrite_tag(tag), add_send_time(record).merge(timestamp_hash(time)).to_json)
      }
      $log.flush

      chain.next
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluent-plugin-mqtt-io-0.2.3 lib/fluent/plugin/out_mqtt.rb
fluent-plugin-mqtt-io-0.2.2 lib/fluent/plugin/out_mqtt.rb