Commit 79a327bf authored by Klaus Wölfel's avatar Klaus Wölfel

Add out plugin wendelin_formatted which allows to configure formatting of output

This can be used for single_value fromatting to send data exactly as read from file
parent 29b893c7
# 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 Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment