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 list of commands available as of Fluent Bit 0.12 series are:
Command
Prototype
Description
@INCLUDE
@INCLUDE FILE
Include a configuration file
@SET
@SET KEY=VAL
Set a configuration variable

@INCLUDE Command

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:
1
[SERVICE]
2
Flush 1
3
4
@INCLUDE inputs.conf
5
@INCLUDE outputs.conf
Copied!
The above example defines the main service configuration file and also include two files to continue the configuration:

inputs.conf

1
[INPUT]
2
Name cpu
3
Tag mycpu
4
5
[INPUT]
6
Name tail
7
Path /var/log/*.log
8
Tag varlog.*
Copied!

outputs.conf

1
[OUTPUT]
2
Name stdout
3
Match mycpu
4
5
[OUTPUT]
6
Name es
7
Match varlog.*
8
Host 127.0.0.1
9
Port 9200
10
Logstash_Format On
Copied!
Note that despites the order of inclusion, Fluent Bit will ALWAYS respect the following order:
    Service
    Inputs
    Filters
    Outputs

@SET Command

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:
1
@SET my_input=cpu
2
@SET my_output=stdout
3
4
[SERVICE]
5
Flush 1
6
7
[INPUT]
8
Name ${my_input}
9
10
[OUTPUT]
11
Name ${my_output}
Copied!
Last modified 1yr ago