r/fluent-bit: Set HOSTNAME environment variable

Fluent-bit does not have any native capability for setting a field with
the hostname of the machine, but it can set a field with the value of an
environment variable.  Thus, we can set the `HOSTNAME` environment
variable and then use that to set the field in the pipeline.
This commit is contained in:
2025-09-15 07:53:13 -05:00
parent d0bffdeb15
commit 0331a55b3e

View File

@@ -10,6 +10,7 @@ StartLimitBurst=5
Type=exec
ExecStart=/usr/bin/fluent-bit -c /etc/fluent-bit/fluent-bit.yml -Y
ExecReload=/bin/kill -HUP $MAINPID
Environment=HOSTNAME=%H
StateDirectory=fluent-bit
Restart=always
RestartSec=1