:plugin: fluent
:type: codec

///////////////////////////////////////////
START - GENERATED VARIABLES, DO NOT EDIT!
///////////////////////////////////////////
:version: %VERSION%
:release_date: %RELEASE_DATE%
:changelog_url: %CHANGELOG_URL%
:include_path: ../../../../logstash/docs/include
///////////////////////////////////////////
END - GENERATED VARIABLES, DO NOT EDIT!
///////////////////////////////////////////

[id="plugins-{type}s-{plugin}"]

=== Fluent codec plugin

include::{include_path}/plugin_header.asciidoc[]

==== Description

This codec handles fluentd's msgpack schema.

For example, you can receive logs from `fluent-logger-ruby` with:
[source,ruby]
    input {
      tcp {
        codec => fluent
        port => 4000
      }
    }

And from your ruby code in your own application:
[source,ruby]
    logger = Fluent::Logger::FluentLogger.new(nil, :host => "example.log", :port => 4000)
    logger.post("some_tag", { "your" => "data", "here" => "yay!" })


NOTE: Fluent uses second-precision for events, so you will not see sub-second precision
on events processed by this codec.


[id="plugins-{type}s-{plugin}-options"]
==== Fluent Codec configuration options

[cols="<,<,<",options="header",]
|=======================================================================
|Setting |Input type|Required
| <<plugins-{type}s-{plugin}-nanosecond_precision>> |<<boolean,boolean>>|No
| <<plugins-{type}s-{plugin}-target>> |<<string,string>>|No
|=======================================================================

&nbsp;

[id="plugins-{type}s-{plugin}-nanosecond_precision"]
===== `nanosecond_precision`

  * Value type is <<boolean,boolean>>
  * Default value is `false`

Enables sub-second level precision while encoding events.

[id="plugins-{type}s-{plugin}-target"]
===== `target`

  * Value type is <<string,string>>
  * There is no default value for this setting.

Define the target field for placing the decoded values. If this setting is not
set, data will be stored at the root (top level) of the event.

For example, if you want data to be put under the `logs` field:
[source,ruby]
    input {
      tcp {
        codec => fluent {
          target => "[logs]"
        }
        port => 4000
      }
    }

