-2

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
  • 1
  • 1

1 Answers1

0

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
  • 1,203
  • 10
  • 23
  • Thank you for your reply, any clue to capture specific deployment/Pod's logs ? – anil Mar 07 '21 at 05:43
  • You can configure the Autodiscover feature in Filebeat. There is an example of a filebeat operator here https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-beat-configuration-examples.html#k8s_filebeat_with_autodiscover and take a look at the autodiscover configuration here: https://www.elastic.co/guide/en/beats/filebeat/current/configuration-autodiscover.html – eitann Mar 07 '21 at 06:25
  • can i capture container logs within pod without using ECK and volumes, because of volumes my filebeat container will be reading all available container's log – anil Mar 07 '21 at 06:43