Configuration Variables
Fluent Bit support the usage of environment variables in any value associated to a key when using a configuration file.
The variables are case sensitive and can be used in the following format:
1
${MY_VARIABLE}
Copied!
When Fluent Bit starts, the configuration reader will detect any request for ${MY_VARIABLE} and will try to resolve it value.

Example

Create the following configuration file (fluent-bit.conf):
1
[SERVICE]
2
Flush 1
3
Daemon Off
4
Log_Level info
5
6
[INPUT]
7
Name cpu
8
Tag cpu.local
9
10
[OUTPUT]
11
Name ${MY_OUTPUT}
12
Match *
Copied!
Open a terminal and set the environment variable:
1
$ export MY_OUTPUT=stdout
Copied!
The above command set the 'stdout' value to the variable MY_OUTPUT.
Run Fluent Bit with the recently created configuration file:
1
$ bin/fluent-bit -c fluent-bit.conf
2
Fluent-Bit v0.11.0
3
Copyright (C) Treasure Data
4
5
[2017/04/03 12:25:25] [ info] [engine] started
6
[0] cpu.local: [1491243925, {"cpu_p"=>1.750000, "user_p"=>1.750000, "system_p"=>0.000000, "cpu0.p_cpu"=>3.000000, "cpu0.p_user"=>2.000000, "cpu0.p_system"=>1.000000, "cpu1.p_cpu"=>0.000000, "cpu1.p_user"=>0.000000, "cpu1.p_system"=>0.000000, "cpu2.p_cpu"=>4.000000, "cpu2.p_user"=>4.000000, "cpu2.p_system"=>0.000000, "cpu3.p_cpu"=>1.000000, "cpu3.p_user"=>1.000000, "cpu3.p_system"=>0.000000}]
Copied!
As you can see the service worked properly as the configuration was valid.
Last modified 2yr ago
Export as PDF
Copy link
Contents
Example