某些Fluentd插件(一般是output)支持<format>配置项,用来指定如何格式化record。
- Format配置项可以使用在<match>或<filter>配置项中。
<match tag.*> @type file # parameters for output plugin <format> # format section parameters </format> </match> - 需要在<format>中通过@type来指定格式化插件类型。
<format> @type json </format> Fluentd内核绑定了若干常用的格式化插件,当然也可以根据需要安装第三方插件。以下为内置的格式化插件: out_file:将每个事件输出为一行,事件的三个属性以分隔符分隔 json:将事件输出为json格式,默认只包含record属性 ltsv:将事件输出为LTSV格式 csv:将事件输出为csv格式 msgpack:将事件输出为msgpack二进制 hash:将事件输出为ruby hash格式,默认只包含record属性 single_value:输出事件的record的单字段值
这些插件都有详细的说明文档,可在使用时参考。
|