Configuration File
Fluent Bit allows to use one configuration file which works at a global scope and uses the schema defined previously.
The configuration file supports four types of sections:
In addition there is an additional feature to include external files:
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:
The Name is mandatory and it let 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).
The following is an example of an INPUT section:
Name cpu
A FILTER section defines a filter (related to an filter plugin), here we will describe the base configuration for each FILTER section. Note that each filter plugin may add it own configuration keys:
The Name is mandatory and it let 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.
The following is an example of an FILTER section:
The following is an example of an OUTPUT section:
[OUTPUT]
Match my*cpu
The following configuration file example demonstrates how to collect CPU metrics and flush the results every five seconds to the standard output:
To avoid complicated long configuration files is better to split specific parts in different files and call them (include) from one main file.
Starting from Fluent Bit 0.12 the new configuration command @INCLUDE has been added and can be used in the following way:
The configuration reader will try to open the path somefile.conf, if not found, it will assume it’s a relative path based on the path of the base configuration file, e.g:
- Main configuration file path: /tmp/main.conf
- Fluent Bit will try to open somefile.conf, if it fails it will try /tmp/somefile.conf.
Wildcard character (*) is supported to include multiple files, e.g: