Stern Logs

Read, filter and search Kubernetes pod logs with stern — the multi-pod, multi-container log tailer. Use whenever the task involves looking at logs from a Kubernetes cluster: debugging a failing deployment, checking why pods crash-loop, grepping errors across a namespace, following a rollout, or correlating logs across several pods. Trigger phrases: "check the logs", "tail the logs", "why is this pod failing", "grep the errors in namespace X", "看一下 log", "查 k8s 的 log", "stern", "kubectl logs but for many pods", "logs across all pods of deployment/service", "CrashLoopBackOff logs". Also covers stern's Go templates for reformatting JSON application logs and `--stdin` for replaying a local log file through those templates. NOT for writing application logging code, not for log aggregation backends (Loki/ELK/CloudWatch queries), and not a replacement for `kubectl get`/ `describe` when the question is about pod state rather than log content.

shyuan 5241e7a 7 files · 62.9 KB Updated

File contents

shyuan/skills/tree/main/skills/stern-logs commit 5241e7abeb

Frequently asked questions

npx skillmds@latest add shyuan/stern-logs