Open Oloremo opened 8 years ago
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?
Im totally ok with this example.
@gjtempleton Any updates? Just wondering...
Hello, this feature seems to be a must have to me :-) Otherwise it's not possible to pair decoders with specific containers.
@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.
@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?
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.