Commands
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 following commands are available:
@INCLUDE
@INCLUDEConfiguring a logging pipeline might lead to an extensive configuration file. In order to maintain a human-readable configuration, split the configuration in multiple files.
The @INCLUDE command allows the configuration reader to include an external configuration file:
[SERVICE]
Flush 1
@INCLUDE inputs.conf
@INCLUDE outputs.confThis example defines the main service configuration file and also includes two files to continue the configuration.
Fluent Bit will respects the following order when including:
Service
Inputs
Filters
Outputs
inputs.conf
inputs.confThe following is an example of an inputs.conf file, like the one called in the previous example.
[INPUT]
Name cpu
Tag mycpu
[INPUT]
Name tail
Path /var/log/*.log
Tag varlog.*outputs.conf
outputs.confThe following is an example of an outputs.conf file, like the one called in the previous example.
[OUTPUT]
Name stdout
Match mycpu
[OUTPUT]
Name es
Match varlog.*
Host 127.0.0.1
Port 9200
Logstash_Format On@SET
@SETFluent 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. It can't be used inside a section:
// DO NOT USE
@SET my_input=cpu
@SET my_output=stdout
[SERVICE]
Flush 1
[INPUT]
Name ${my_input}
[OUTPUT]
Name ${my_output}Last updated
Was this helpful?