Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

DockerLogInput and containers filter #1943

Open
Oloremo opened this issue Jun 7, 2016 · 6 comments
Open

DockerLogInput and containers filter #1943

Oloremo opened this issue Jun 7, 2016 · 6 comments

Comments

@Oloremo
Copy link

Oloremo commented Jun 7, 2016

Hello!

Right now DockerLogInput plugin attaching to all running containers, sometimes it's not desirable. Docker API have a filter option for getting list of the containers and it will be really nice if DockerLogInput could use that filter, so we could filter out unneeded containers.

@gjtempleton
Copy link
Contributor

This is something I've been thinking about implementing myself for both DockerLogs and DockerStats, borrowing from the message_matcher= syntax and allowing for wildcards.

Foreseeing allowing specification by container_matcher="ContainerLabel[foo] == 'bar'", ..."ContainerName == '*goldwasser'", ..."ContainerImage != 'nginx*'".

Is this something others would be interested in, and if so, does this seem a sensible way to proceed? I would think those three criteria would match every use case I can think of using current best practice?

@Oloremo
Copy link
Author

Oloremo commented Jun 8, 2016

Im totally ok with this example.

@Oloremo
Copy link
Author

Oloremo commented Aug 1, 2016

@gjtempleton Any updates? Just wondering...

@fpytloun
Copy link

fpytloun commented Aug 3, 2016

Hello, this feature seems to be a must have to me :-)
Otherwise it's not possible to pair decoders with specific containers.

@gjtempleton
Copy link
Contributor

gjtempleton commented Aug 3, 2016

@Oloremo Sorry, life rather got in the way of this.

I wrote a quick and very dirty hack to get what I wanted out of this at work and only getting back around to writing something general enough I'd be happy enough to contribute back now. Probably halfway there with the logic.

@fpytloun If you're only wanting to send specific containers' output to specific decoders I think you could achieve what you want using fields_from_labels and using these fields with the message_matcher for each decoder.

@fpytloun
Copy link

fpytloun commented Aug 4, 2016

@gjtempleton Thank you, that probably may work for my use-case. So I will have to use DockerInput with MultiDecoder and message_matcher for each decoder?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants