Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions administration/configuring-fluent-bit/classic-mode/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ ${MY_VARIABLE}

When Fluent Bit starts, the configuration reader will detect any request for `${MY_VARIABLE}` and will try to resolve its value.

When Fluent Bit is running under systemd (using the official packages), environment variables can be set in the following files:
* `/etc/default/fluent-bit` (Debian based system)
* `/etc/sysconfig/fluent-bit` (Others)
When Fluent Bit is running under [`systemd`](https://systemd.io/) (using the official packages), environment
variables can be set in the following files:

These files are ignored if they do not exist.
- `/etc/default/fluent-bit` (Debian based system)
- `/etc/sysconfig/fluent-bit` (Others)

These files are ignored if they don't exist.

## Example

Create the following configuration file \(`fluent-bit.conf`\):

```text
```yaml
[SERVICE]
Flush 1
Daemon Off
Expand All @@ -40,10 +42,10 @@ Create the following configuration file \(`fluent-bit.conf`\):
Open a terminal and set the environment variable:

```bash
$ export MY_OUTPUT=stdout
export MY_OUTPUT=stdout
```

> The above command set the 'stdout' value to the variable `MY_OUTPUT`.
The previous command sets the `stdout` value to the variable `MY_OUTPUT`.

Run Fluent Bit with the recently created configuration file:

Expand All @@ -58,6 +60,3 @@ Fluent Bit v1.4.0
[2020/03/03 12:25:25] [ info] [engine] started
[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}]
```

As you can see the service worked properly as the configuration was valid.