Configuration File
This page describes the main configuration file used by Fluent Bit.
One of the ways to configure Fluent Bit is using a main configuration file. Fluent Bit allows the use one configuration file that works at a global scope and uses the defined Format and Schema.
The main configuration file supports four sections:
Service
Input
Filter
Output
It's also possible to split the main configuration file into multiple files using the Include File feature to include external files.
Service
The Service
section defines global properties of the service. The following keys are:
Key | Description | Default Value |
---|---|---|
| Set the flush time in |
|
| Set the grace time in |
|
daemon | Boolean. Determines whether Fluent Bit should run as a Daemon (background). Allowed values are: |
|
| Set the primary transport layer protocol used by the asynchronous DNS resolver. Can be overridden on a per plugin basis. |
|
| Absolute path for an optional log file. By default all logs are redirected to the standard error interface (stderr). | none |
| Set the logging verbosity level. Allowed values are: |
|
| Path for a | none |
| Path for a | none |
| Path for the Stream Processor configuration file. Learn more about Stream Processing configuration. | none |
| Enable the built-in HTTP Server. |
|
| Set listening interface for HTTP Server when it's enabled. |
|
| Set TCP Port for the HTTP Server. |
|
| Set the coroutines stack size in bytes. The value must be greater than the page size of the running system. Setting the value too small ( |
|
| Set a maximum retry time in seconds. Supported in v1.8.7 and greater. |
|
| Set a base of exponential backoff. Supported in v1.8.7 and greater. |
|
| If enabled, |
|
| If enabled, Stream processor converts from number string to number type. |
|
The following is an example of a SERVICE
section:
For scheduler and retry details, see scheduling and retries.
Config input
The INPUT
section defines a source (related to an input plugin). Each input plugin can add its own configuration keys:
Key | Description |
---|---|
| Name of the input plugin. |
| Tag name associated to all records coming from this plugin. |
| Set the plugin's logging verbosity level. Allowed values are: |
Name
is mandatory and tells Fluent Bit which input plugin to load. Tag
is mandatory for all plugins except for the input forward
plugin, which provides dynamic tags.
Example
The following is an example of an INPUT
section:
Config filter
The FILTER
section defines a filter (related to an filter plugin). Each filter plugin can add it own configuration keys. The base configuration for each FILTER
section contains:
Key | Description |
---|---|
| Name of the filter plugin. |
| A pattern to match against the tags of incoming records. Case sensitive, supports asterisk ( |
| A regular expression to match against the tags of incoming records. Use this option if you want to use the full regular expression syntax. |
| Set the plugin's logging verbosity level. Allowed values are: |
Name
is mandatory and lets Fluent Bit know which filter plugin should be loaded. Match
or Match_Regex
is mandatory for all plugins. If both are specified, Match_Regex
takes precedence.
Filter example
The following is an example of a FILTER
section:
Config output
The OUTPUT
section specifies a destination that certain records should go to after a Tag
match. Fluent Bit can route up to 256 OUTPUT
plugins. The configuration supports the following keys:
Key | Description |
---|---|
| Name of the output plugin. |
| A pattern to match against the tags of incoming records. Case sensitive and supports the asterisk ( |
| A regular expression to match against the tags of incoming records. Use this option if you want to use the full regular expression syntax. |
| Set the plugin's logging verbosity level. Allowed values are: |
Output example
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:
Config 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. The @INCLUDE
can be used in the following way:
The configuration reader will try to open the path somefile.conf
. If not found, the reader assumes the file is on a relative path based on the path of the base configuration file:
Main configuration path:
/tmp/main.conf
Included file:
somefile.conf
Fluent Bit will try to open
somefile.conf
, if it fails it will try/tmp/somefile.conf
.
The @INCLUDE
command only works at top-left level of the configuration line, and can't be used inside sections.
Wildcard character (*
) supports including multiple files. For example:
Files matching the wildcard character are included unsorted. If plugin ordering between files needs to be preserved, the files should be included explicitly.
Last updated