Kubernetes Log Splitting (Stdout/Stderr)

4/14/2020

When I call kubectl logs pod_name, I get both the stdout/err combined. Is it possible to specify that I only want stdout or stderr? Likewise I am wondering if it is possible to do so through the k8s rest interface. I've searched for several hours and read through the repository but could not find anything.

Thanks!

-- Zel
client-go
kubernetes

1 Answer

4/14/2020

No, this is not possible. To my knowlegde, the moment of writing this, kubernetes supports only one logs api endpoint that returns all logs (stdout and stderr combined).

If you want to access them separately you should consider using different logging driver or query logs directly from docker.

-- HelloWorld
Source: StackOverflow