Collect selected container logs from Kubernetes

I'm trying to find a solution for gathering stdout logs from only selected pods in our Kubernetes cluster. We're huge fans of using annotations to specify the behavior of things. Would be great to be able to set a pod annotation to indicate that Filebeat should harvest docker logs from containers in the pod (either on a pod-by-pod basis or somehow with more control of logging from the individual containers in a pod).

Is anything like this available/planned for Filebeat, or is it simple all or nothing?

Hi @trondhindenes,

Hints based autodiscover allows you to disable logs retrieval for any container, some users have requested the inverse behavior, having it disabled by default and require an annotation to enable it, is that what you want?

Best regards

Wow, yes that's exactly what I'm after. The extra functionality flags the Issue OP asks for would be nice as well. In general one flag to turn stuff on/off, and then other flags to configure the feature given that it's enabled is often a good pattern.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.