/etc/fluent/plugin
directory.lib/fluent/plugin/<TYPE>_<NAME>.rb
file. The TYPE is:in
for input pluginsout
for output pluginsfilter
for filter pluginsbuf
for buffer pluginsparser
for parser pluginsformatter
for formatter pluginslib/fluent/plugin/out_mail.rb
. The packaged gem can be distributed and installed using RubyGems. For further information, please see the list of Fluentd plugins for third-party plugins.0.5.0
-> 1.0.0
, 1.2.0
-> 2.0.0
.initialize
, configure
and start
, super
should be called to call Input plugin default behaviour.router.emit(tag, time, record)
method, where tag
is the String, time
is the UNIX time integer and record
is a Hash object.router.emit_stream(tag, es)
and MultiEventStream
combo instead.initialize
, configure
and start
, super
should be called to call BufferedOutput plugin default behaviour.out_file
plugin.buffer_path
option is required.initialize
, configure
and start
, super
should be called to call non-buffered Output plugin default behaviour.initialize
, configure
, start
and shutdown
, super
should be called to call Filter plugin default behaviour.filter
method. But if you want to mutate the event stream itself, you can override filter_stream
method.filter_stream
.time_key_value
). It takes one optional parameter called delimiter
, which is the delimiter for key-value pairs. It also takes time_format
to parse the time string. In initialize
, configure
and start
, super
should be called to call Parser plugin default behaviour.parser_time_key_value.rb
in a loadable plugin path. Then, if in_tail is configured as2014-01-01T00:00:00 k=v a=b
is parsed as 2013-01-01 00:00:00 +0000 test: {"k":"v","a":"b"}
.Parser#parse
API is called with block. We will remove Parser#parse
with return value API since v0.14 or later.initialize
, configure
and start
, super
should be called to call Formatter plugin default behaviour.formatter_my_csv.rb
in a loadable plugin path. Then, if out_file is configured as{"k1": 100, "k2": 200}
is matched, the output file should look like 100,200
router
has emit_error_event
API to rescue invalid events. Emitted events via emit_error_event
are routed to @ERROR
label.config_param
helper defines plugin parameter. You don't need to parse parameters manually. config_param
syntax is config_param :name, :type, options
. Here is simple example:param1
is required string parameter. If a user doesn't specify param1
, fluentd raises an ConfigError
. On the other hand, param2
is optional integer parameter. If a user doesn't specify param2
, fluentd set 10
to param2
automatically. If a user sets "5" to param2
parameter, fluentd converts it into integer type automatically.config_param
sets parsed result to :name
instance variable after configure
call. See example below:default
: Specified parameter becomes optional. type
value ornil
are available: default: 10
, default: nil
.secret
: Specified parameter is masked when dump a configuration,secret: true
deprecated
: Specified parameter is showed in warning log. Needdeprecated: "Use xxx instead"
obsoleted
: Specified parameter is showed in error log withobsoleted: "Use xxx instead"
fluentd
with the -vv
option to show debug messages:TEST
environment variable: