You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a race condition; often times if not virtually always, fluentd starts before hostnamectl can do its thing, and any output specifiers that contain ${HOSTNAME} end up with an incorrect value.
To Reproduce
Build a fluentbit AMI based on amazon linux 2 using packer/ansible/chef/puppet/what have you. Include fluentbit from https://packages.fluentbit.io/amazonlinux/2/
Have an output (say to S3) that has ${HOSTNAME} in it: s3_key_format /logs/%Y/%m/%d/%H/$TAG/${HOSTNAME}/$UUID.log.gz
Launch an instance of this AMI.
Watch as the HOSTNAME portion of the output path is incorrect until either fluentbit is restarted or the system is rebooted.
Expected behavior ${HOSTNAME} should match the hostname configured by hostnamectl
Additional context
I worked around this by adding this to /etc/systemd/system/fluent-bit.service.d/override.conf:
Bug Report
Describe the bug
init/systemd.in
contains this:Unfortunately, Amazon Linux 2 still uses an old
hostnamectl
invocation like so:This is a race condition; often times if not virtually always, fluentd starts before
hostnamectl
can do its thing, and any output specifiers that contain${HOSTNAME}
end up with an incorrect value.To Reproduce
https://packages.fluentbit.io/amazonlinux/2/
${HOSTNAME}
in it:s3_key_format /logs/%Y/%m/%d/%H/$TAG/${HOSTNAME}/$UUID.log.gz
Expected behavior
${HOSTNAME}
should match the hostname configured byhostnamectl
Additional context
I worked around this by adding this to
/etc/systemd/system/fluent-bit.service.d/override.conf
:But I don't think folks should have to do that :(
The text was updated successfully, but these errors were encountered: