Versions | v0.14 (td-agent3)

This page is for v0.14, not the latest stable version which is v0.12. For the latest stable version of this article, click here.


Plugin Common Parameters

Some common parameters are available for all (or a part of) Fluentd plugins. This page describes the list of these parameters.

Table of Contents

Parameters for all plugins

@type

The parameter @type is to specify the type of plugin for the section.

<source>
  @type my_plugin_type
</source>

<filter>
  @type my_filter
</filter>

@id

The @id parameter is used to add the unique name of plugin configuration, which is used for paths of buffer/storage, logging and other purposes.

<match>
  @type file
  @id   service_www_accesslog
  path  /path/to/my/access.log
  # ...
</match>

This parameter should be specified for all plugins to enable root_dir and workers feature globally.

See also: System Configuration.

@log_level

This parameter is to specify plugin-specific logging level. The default log level is info. Global log level can be specified by log_level in <system>, or -v/-q command line options. The @log_level parameter overwrites logging level only for specified plugin instance.

<system>
  log_level info
</system>

<source>
  # ...
  @log_level debug  # show debug log only for this plugin
</source>

The main purposes of this parameter are:

  • Suppress too many logs only for that plugin
  • Show debug logs while debugging that plugin

Parameters for plugins which emit events

@label

The @label parameter is to route input events to <label> sections, the set of <filter> and <match> sections.

<source>
  @type  ...
  @label @access_logs
  # ...
</source>

<source>
  @type  ...
  @label @system_metrics
  # ...
</source>

<label @access_log>
  <match **>
    @type file
    path  ...
  </match>
</label>

<label @system_metrics>
  <match **>
    @type file
    path  ...
  </match>
</label>

The values of @label parameter MUST start with @ character.

Specifying @label is strongly recommended to route events to any plugins, without modifying tags. It can make the whole configurations simple.

Last updated: 2017-02-28 16:48:19 +0000

Versions | v0.14 (td-agent3)

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), originally invented by Treasure Data, Inc. All components are available under the Apache 2 License.

Interested in the Fluentd Newsletters?