derailed / k9s

🐶 Kubernetes CLI To Manage Your Clusters In Style!
https://k9scli.io
Apache License 2.0
26.52k stars 1.66k forks source link

Combined Logs: print logs of multiple containers in one view #827

Open wolfgang-braun opened 4 years ago

wolfgang-braun commented 4 years ago




When having multiple replicas (meaning multiple containers) I can't print all logs at once.

It would be awesome if it I could select multiple containers using <space> and hit <L> afterwards to get a single log view, which displays the log messages of all containers with a container-id-prefix.

Right now i can only achieve this by opening multiple terminal tabs.

Thanks!

derailed commented 4 years ago

@wolfgang-braun Currently k9s will list all containers in a pod. You can view all associated containers logs by pressing l on the selected pod. Are you looking for a different behavior? If so please clarify. Tx!

wolfgang-braun commented 4 years ago

@derailed thanks for your reply. The tool is really awesome.

I mean that it would be cool to tail the logs of multiple pods at once.

Currently you can multiselect them to delete them. It’d be great to use this selection feature to print all logs of the selected pods.

rocketraman commented 4 years ago

Agreed this would be useful for me too -- currently I do this with stern filters outside of k9s.

yujunz commented 3 years ago

You may press l on the parent resource (e.g. deployment, services, statefulset) for all related pods. Is that good enough?

rocketraman commented 3 years ago

You may press l on the parent resource (e.g. deployment, services, statefulset) for all related pods. Is that good enough?

@yujunz Not in my situation... my use case is selecting pods from different deployments, and ideally being able to select different deployments and seeing logs from every related pod.

wolfgang-braun commented 3 years ago

You may press l on the parent resource (e.g. deployment, services, statefulset) for all related pods. Is that good enough?

@yujunz Also not in my situation, because the parents contain pods I don't want to see the logs for.

bentito commented 3 years ago

@wolfgang-braun <space> to multi-select? I tried holding shift while down-arrowing and no luck... Then I read your post. Thanks!

NemesisRE commented 2 years ago

With the stern plugin this should be possible but as we do not have a $SELECTION variable we can only use $FILTER which is not exact enough, @derailed would it be possible to implement $SELECTION for plugins?

karunpoudel-chr commented 2 weeks ago

Seems like this feature is available in v0.32.4 I can multiselect pods using space and then press L to see logs from all of them. ctrl-space to select range doesn't seem to be working.