logspout
logspout copied to clipboard
logspout tags message with wrong tag if SYSLOG_TAG/HOSTNAME empty
Hi,
given SYSLOG_TAG/HOSTNAME is set to templates via the env variable like this:
SYSLOG_TAG='{{ index .Container.Config.Labels "io.kubernetes.pod.namespace" }}[{{ index .Container.Config.Labels "io.kubernetes.pod.name" }}]'
SYSLOG_HOSTNAME='{{ index .Container.Config.Labels "io.kubernetes.container.name" }}'
logspout will tag the syslog messages properly if these labels exist. If a container has no labels at all, logspout will tag the message with some other tag.
In my case all containers except one are managed by kubernetes. Log lines from that one container show up with the tags for another container running on my systems. Looking at the code, it's not clear right away how that could happen. Maybe it's even an issues with papertrail. Will try to isolate this further later.