An environment variable is a named runtime value that makes Fluent Bit configuration dynamic. Use it to keep one monitoring configuration while changing destinations, credentials, tags, or other environment-specific values. section 2.5
Apply environment variables in Fluent Bit by:
- Defining a value before startup, such as Linux's `export myTag=my-dummy-tag`; Windows uses `set` instead. section 2.5.1
- Referencing the value with `${myTag}` inside configuration expressions. section 2.5.1
- Running Fluent Bit with the configuration; a resolved value changes the resulting tag, while an unset value causes an unknown-property error. section 2.5.1
- Using Modify or Record filters when an attribute requires a literal string rather than environment-variable substitution. section 2.5.1
Change a Fluent Bit tag at startup
Set `myTag` with `export myTag=my-dummy-tag`, then use `tag ${myTag}` in the input configuration and run `fluent-bit -c hello-world-variable.conf`. The output uses `my-dummy-tag` instead of `dummy1`; omitting the variable prevents successful resolution. section 2.5.1
Listing 2.9 Using environment variables
[input]
name dummy
dummy {"hello":"my world"}
tag ${myTag} #1
The configuration fragment shows environment-variable syntax directly in a Fluent Bit input definition. section 2.5.1
Fluent Bit can also assign variables with `@set`, making shared values portable across operating systems and included configuration files. An `@set` value overrides an OS-level variable with the same name. section 2.5.2
In containers, injected environment variables can identify instances and let a Fluent Bit sidecar add context without coupling application code to a deployment environment. section 4.6


















