Skip to content

Adds a .Env function on syslog messages#100

Closed
dfuentes wants to merge 1 commit into
gliderlabs:masterfrom
Clever:add-env-template-option
Closed

Adds a .Env function on syslog messages#100
dfuentes wants to merge 1 commit into
gliderlabs:masterfrom
Clever:add-env-template-option

Conversation

@dfuentes

Copy link
Copy Markdown

I know the usual method to do changes like this is rolling a custom logspout container with our modified syslog adapter module, but I thought this change might be generally useful.

We've run into the issue where we want to add some container specific information to our log lines, but don't have control of either the container hostname or container name (we are on mesos/marathon). Allowing using container environment variables in the syslog configuration templates (i.e. SYSLOG_TAG) allows us to pull in this custom info.

@dfuentes dfuentes force-pushed the add-env-template-option branch from 4f39700 to 8378e4d Compare May 11, 2015 18:49
@ejholmes

Copy link
Copy Markdown

👍 👍 this would be really handy.

@sebest

sebest commented Sep 25, 2015

Copy link
Copy Markdown

Any feedback on adding this feature? Would be really useful on ECS, thanx

@sebest

sebest commented Sep 25, 2015

Copy link
Copy Markdown

I found a solution using labels on ECS and the SYSLOG_TAG environment variable of logspout:

SYSLOG_TAG="{{ index .Container.Config.Labels "com.amazonaws.ecs.container-name" }}"

@Carles-Figuerola

Copy link
Copy Markdown

Look at #182, it should solve this problem and can be changed at runtime to the desired .Env key you want

- This allows you to use docker container environment variables in the
  templates for things like SYSLOG_TAG
@dfuentes dfuentes force-pushed the add-env-template-option branch from 8378e4d to 173058a Compare July 12, 2016 19:21
@dfuentes

dfuentes commented Aug 7, 2017

Copy link
Copy Markdown
Author

Closing this, it's pretty old at this point, and I no longer use logspout

@dfuentes dfuentes closed this Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants