-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added the ability to include only container having label using INCLUDE_LABEL param #222
base: master
Are you sure you want to change the base?
Conversation
Don't we have this somewhere already? |
Maybe i missed that, but as i saw there are some things similar when logs are routed, but no things when logs are pumped. |
includeLabel := getopt("INCLUDE_LABEL", "") | ||
if includeLabel != "" { | ||
if _, ok := container.Config.Labels[includeLabel]; ok { | ||
// include all containers that have the includeLabel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments shouldn't be necessary, and if they are, the code needs to be made more clear.
@josegonzalez : I simplified the code as i can (i my first time with golang), and updated the README.md. |
@josegonzalez did my code need documentation ? |
what's the difference between this vs the filter approach? |
May be, misunderstood the filter approach. My use case is to have a docker-compose file with a list of containers for my application. And I want to add logspout container to this compose file. I want logspout to load only the compose container 's logs and expose them throw http module. How can I do that using filter approach. |
@MattAitchison @josegonzalez Thoughts on having both |
Added the ability to include only container having label using INCLUDE_LABEL param (Same as EXCLUDE_LABEL). I'm using this feature to use logspout container into docker-compose.yml. add expose log of others services throw http