Configuration files must be flexible enough for any deployment need, but they must keep a clean and readable format.
Fluent Bit Commands extends a configuration file with specific built-in features. The list of commands available as of Fluent Bit 0.12 series are:
Configuring a logging pipeline might lead to an extensive configuration file. In order to maintain a human-readable configuration, it's suggested to split the configuration in multiple files.
The @INCLUDE command allows the configuration reader to include an external configuration file, e.g:
[SERVICE]Flush 1​@INCLUDE inputs.conf@INCLUDE outputs.conf
The above example defines the main service configuration file and also include two files to continue the configuration:
[INPUT]Name cpuTag mycpu​[INPUT]Name tailPath /var/log/*.logTag varlog.*
[OUTPUT]Name stdoutMatch mycpu​[OUTPUT]Name esMatch varlog.*Host 127.0.0.1Port 9200Logstash_Format On
Note that despites the order of inclusion, Fluent Bit will ALWAYS respect the following order:
Service
Inputs
Filters
Outputs
Fluent Bit supports configuration variables, one way to expose this variables to Fluent Bit is through setting a Shell environment variable, the other is through the @SET command.
The @SET command can only be used at root level of each line, meaning it cannot be used inside a section, e.g:
@SET my_input=cpu@SET my_output=stdout​[SERVICE]Flush 1​[INPUT]Name ${my_input}​[OUTPUT]Name ${my_output}