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:
@@ -10,6 +10,7 @@ StartLimitBurst=5
|
|||||||
Type=exec
|
Type=exec
|
||||||
ExecStart=/usr/bin/fluent-bit -c /etc/fluent-bit/fluent-bit.yml -Y
|
ExecStart=/usr/bin/fluent-bit -c /etc/fluent-bit/fluent-bit.yml -Y
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
Environment=HOSTNAME=%H
|
||||||
StateDirectory=fluent-bit
|
StateDirectory=fluent-bit
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=1
|
RestartSec=1
|
||||||
|
|||||||
Reference in New Issue
Block a user