stern
Kubernetes log tailing tool that aggregates logs from multiple pods and containers with regex filtering and color coding
Stern is a Kubernetes log aggregation tool that allows you to tail logs from multiple pods and containers simultaneously. Unlike kubectl logs which handles one pod at a time, Stern uses regular expressions to match pod names, automatically discovering and following logs from all matching pods. When pods are deleted or created, Stern dynamically adjusts its log streams without manual intervention.
The tool provides regex-based filtering for both pod selection and log content. You can specify container patterns to limit which containers within pods to monitor, exclude specific log lines, or highlight important patterns. Stern supports querying pods by Kubernetes resources like deployments or services using the format 'resource/name', making it easier to follow logs from entire application deployments.
Stern includes multiple output formats including JSON for programmatic use and custom Go templates for structured log processing. It integrates with standard Kubernetes authentication methods, respects namespace contexts, and provides color-coded output to distinguish between different pods and containers. The tool supports field selectors, label selectors, and various Kubernetes resource types including deployments, daemonsets, and statefulsets.
Installation
# via Homebrew
brew install stern
# via Go
go install github.com/stern/stern@latest
# via Kubectl Krew
kubectl krew install stern
Alternatives & related tools
viddy
Enhanced watch command replacement with time machine mode, diff highlighting, and vim-like navigation
tufw
Terminal user interface for managing ufw firewall rules with add, edit, and remove functionality
kure
Command-line password manager with AES-GCM encryption and offline operation
ssm
Terminal UI for managing and connecting to SSH hosts with vim-style navigation and tagging
Kopia
Cross-platform backup tool that creates encrypted, compressed, deduplicated snapshots and stores them on cloud, network, or local storage. Includes CLI and GUI.
add a badge to your README
Maintain stern? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/stern?utm_source=badge)<a href="https://www.trmn.sh/tools/stern?utm_source=badge"><img src="https://www.trmn.sh/badge/stern.svg" alt="Featured on trmn" height="20"></a>