Sha256: 36344dfb507981fd56ae745eb678b685d869e513424a394483f43f9b03de58a7

Contents?: true

Size: 1.69 KB

Versions: 1

Compression:

Stored size: 1.69 KB

Contents

# Fluentd output plugin to ingest data to Wendelin system
# Copyright (C) 2015  Nexedi SA and Contributors.
#                     Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
# it under the terms of the GNU General Public License version 3, or (at your
# option) any later version, as published by the Free Software Foundation.
#
# You can also Link and Combine this program with other software covered by
# the terms of any of the Free Software licenses or any of the Open Source
# Initiative approved licenses and Convey the resulting work. Corresponding
# source of such a combination shall include the source code for all other
# software used.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See COPYING file for full licensing terms.
# See https://www.nexedi.com/licensing for rationale and options.

# This plugin hooks into Fluentd in a way similiar to out_forward and
# out_secure_forward and outputs event stream to a Wendelin HTTP endpoint.

require 'fluent/plugin/formatter'
require_relative 'out_wendelin'


module Fluent::Plugin  
  class WendelinOutputFormatted < WendelinOutput
    Fluent::Plugin.register_output('wendelin_formatted', self)
	
	helpers :formatter
	
	config_section :format do
	  config_set_default :@type, 'single_value'
	end
	
    def configure(conf)
        super
		@formatter = formatter_create
	end

    def formatted_to_msgpack_binary?
      @formatter_configs.first[:@type] == 'msgpack'
    end

	def format(tag, time, record)
        @formatter.format(tag, time, record)
	end
	
	def write(chunk)
	  super
	end
  
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fluent-plugin-wendelin-0.5 lib/fluent/plugin/out_wendelin_formatted.rb