Configuration File
This page describes the yaml configuration file used by Fluent Bit
One of the ways to configure Fluent Bit is using a YAML configuration file that works at a global scope.
The yaml configuration file supports the following sections:
Env
Service
Pipeline
Inputs
Filters
Outputs
YAML configuration is used in the smoke tests for containers so an always-correct up-to-date example is here: https://github.com/fluent/fluent-bit/blob/master/packaging/testing/smoke/container/fluent-bit.yaml.
Env
The env section allows to configure variables that will be used later on this configuration file.
Example:
Service
The service section defines global properties of the service, the keys available as of this version are described in the following table:
The following is an example of a service section:
For scheduler and retry details, please check there: scheduling and retries
Pipeline
A pipeline section will define a complete pipeline configuration, including inputs, filters and outputs subsections.
Each of the subsections for inputs, filters and outputs constitutes an array of maps that has the parameters for each.
As an example, this pipeline consists of two inputs; a tail plugin and an http server plugin. Each plugin has its own map in the array of inputs consisting of simple properties. To use more advanced properties that consist of multiple values the property itself can be defined using an array, ie: the record and allowlist_key properties for the record_modifier filter:
In the cases where each value in a list requires two values they must be separated by a space, such as in the record property for the record_modifier filter.
Input
An input section defines a source (related to an input plugin). Here we will describe the base configuration for each input section. Note that each input plugin may add it own configuration keys:
The Name is mandatory and it lets Fluent Bit know which input plugin should be loaded. The Tag is mandatory for all plugins except for the input forward plugin (as it provides dynamic tags).
Example input
The following is an example of an input section for the cpu plugin.
Filter
A filter section defines a filter (related to a filter plugin). Here we will describe the base configuration for each filter section. Note that each filter plugin may add its own configuration keys:
The Name is mandatory and it lets Fluent Bit know which filter plugin should be loaded. The Match or Match_Regex is mandatory for all plugins. If both are specified, Match_Regex takes precedence.
Example filter
The following is an example of a filter section for the grep plugin:
Output
The outputs section specify a destination that certain records should follow after a Tag match. Currently, Fluent Bit can route up to 256 OUTPUT plugins. The configuration supports the following keys:
Example output
The following is an example of an output section:
Example: collecting CPU metrics
The following configuration file example demonstrates how to collect CPU metrics and flush the results every five seconds to the standard output:
Last updated