How to read stdout stderr logs in kubernetes within pod using filebeat or logstash,fluentd

3/6/2021

need suggestions how can i capture containers log using stdout or stderr ? within a pod
on following use case ?

my pod contains 3 containers where i want third container to capture logs by using any of these longing options filebeat, logstash or fluentd.

i dont want to save logs in file within containers.

Thanks in advance guys.

-- anil
docker
filebeat
fluentd
kubernetes
logstash

1 Answer

3/6/2021

In case you don't must capture the logs from within the same pod as your containers, you can use ECK's Filebeat Kubernetes operator to automatically set up pods that ships containers logs to Elasticsearch. Read the documentation of ECK here: https://www.elastic.co/guide/en/cloud-on-k8s/current/index.html

-- eitann
Source: StackOverflow