Configuration File
The main configuration file supports four types of sections:
- Service
- Input
- Filter
- Output
In addition, it’s also possible to split the main configuration file in multiple files using the feature to include external files:
- Include File
" class="reference-link">Service
The Service section defines global properties of the service, the keys available as of this version are described in the following table:
Flush | Set the flush time in . The engine loop uses a Flush timeout to define when is required to flush the records ingested by input plugins through the defined output plugins. | 5 |
---|---|---|
Daemon | Boolean value to set if Fluent Bit should run as a Daemon (background) or not. Allowed values are: yes, no, on and off. note: If you are using a Systemd based unit as the one we provide in our packages, do not turn on this option. | Off |
---|---|---|
Log_File | Absolute path for an optional log file. By default all logs are redirected to the standard output interface (stdout). | |
---|---|---|
Log_Level | Set the logging verbosity level. Allowed values are: error, warning, info, debug and trace. Values are accumulative, e.g: if ‘debug’ is set, it will include error, warning, info and debug. Note that trace mode is only available if Fluent Bit was built with the WITH_TRACE option enabled. | info |
---|---|---|
Plugins_File | Path for a plugins configuration file. A plugins configuration file allows to define paths for external plugins, for an example see here. |
|
---|---|---|
Streams_File | Path for the Stream Processor configuration file. To learn more about Stream Processing configuration go . | |
---|---|---|
HTTP_Server | Enable built-in HTTP Server | Off |
---|---|---|
HTTP_Listen | Set listening interface for HTTP Server when it’s enabled | 0.0.0.0 |
---|---|---|
Coro_Stack_Size |
Set the coroutines stack size in bytes. The value must be greater than the page size of the running system. Don't set too small value (say 4096), or coroutine threads can overrun the stack buffer. Do not change the default value of this parameter unless you know what you are doing. |
24576 |
---|
The following is an example of a SERVICE section:
Key | Description |
---|---|
Name | Name of the input plugin. |
Tag | Tag name associated to all records comming from this plugin. |
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:
Tag my_cpu
" class="reference-link">Filter
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:
Key | Description | |
---|---|---|
Name | Name of the filter plugin. | |
Match | A pattern to match against the tags of incoming records. It’s case sensitive and support the star (*) character as a wildcard. | |
Match_Regex | A regular expression to match against the tags of incoming records. Use this option if you want to use the full regex syntax. |
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 OUTPUT section specify a destination that certain records should follow after a Tag match. The configuration support the following keys:
Key | Description | |
---|---|---|
Name | Name of the output plugin. | |
Match | A pattern to match against the tags of incoming records. It’s case sensitive and support the star (*) character as a wildcard. | |
Match_Regex | A regular expression to match against the tags of incoming records. Use this option if you want to use the full regex syntax. |
[OUTPUT]
Name stdout
The following configuration file example demonstrates how to collect CPU metrics and flush the results every five seconds to the standard output:
" class="reference-link">Include File
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:
@INCLUDE somefile.conf
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.
Once the file is found, its contents will replace the @INCLUDE somefile.conf
line. This is a simple textual inclusion. You must still follow the Format and Schema defined previously. For example, you cannot define multiple [SERVICE]
sections.
The @INCLUDE command only works at top-left level of the configuration line, it cannot be used inside sections.