Formatter Plugins
Fluentd has 6 types of plugins: Input, Parser, Filter, Output, Formatter and Buffer. This article gives an overview of Formatter Plugin.
Overview
Sometimes, the output format for an output plugin does not meet one's needs. Fluentd has a pluggable system called Text Formatter that lets the user extend and re-use custom output formats.
How To Use
For an output plugin that supports Text Formatter, the format
parameter can be used to change the output format.
For example, by default, out_file plugin outputs data as
However, if you set format json
like this
The output changes to
i.e., each line is a single JSON object with "time" and "tag fields to retain the event's timestamp and tag.
See this section to learn how to develop a custom formatter.
List of Built-in Formatters
List of Output Plugins with Text Formatter Support
If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is a open source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.
Last updated