Skip to content

Latest commit

 

History

History
84 lines (62 loc) · 2.2 KB

index.asciidoc

File metadata and controls

84 lines (62 loc) · 2.2 KB

Fluent codec plugin

Description

This codec handles fluentd’s msgpack schema.

For example, you can receive logs from fluent-logger-ruby with:

    input {
      tcp {
        codec => fluent
        port => 4000
      }
    }

And from your ruby code in your own application:

    logger = Fluent::Logger::FluentLogger.new(nil, :host => "example.log", :port => 4000)
    logger.post("some_tag", { "your" => "data", "here" => "yay!" })

Notes:

  • the fluent uses a second-precision time for events, so you will never see subsecond precision on events processed by this codec.

Fluent Codec configuration options

Setting Input type Required

nanosecond_precision

boolean

No

target

string

No

 

nanosecond_precision
  • Value type is boolean

  • Default value is false

Enables sub-second level precision while encoding events.

target
  • Value type is 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:

    input {
      tcp {
        codec => fluent {
          target => "[logs]"
        }
        port => 4000
      }
    }