Sha256: cf5645bb0500f173b96efbe2e3019daf9a2eb59df84bdc2aabcab6f4aadcda61

Contents?: true

Size: 567 Bytes

Versions: 4

Compression:

Stored size: 567 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)}, #{record}"
        @connect.publish(rewrite_tag(tag), record.merge(timestamp_hash(time)).to_json)
      }
      $log.flush

      chain.next
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fluent-plugin-mqtt-io-0.0.6 lib/fluent/plugin/out_mqtt.rb
fluent-plugin-mqtt-io-0.0.5 lib/fluent/plugin/out_mqtt.rb
fluent-plugin-mqtt-io-0.0.4 lib/fluent/plugin/out_mqtt.rb
fluent-plugin-mqtt-io-0.0.3 lib/fluent/plugin/out_mqtt.rb