stern
Stern is a Go-based CLI tool for tailing logs from multiple Kubernetes pods and containers simultaneously, with color-coded output for easier debugging. It supports regex-based pod queries, automatic detection of new/deleted pods, and works across namespaces with flexible filtering options.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | stern/stern |
| Owner | stern |
| Primary language | Go |
| License | Apache-2.0 — OSI-approved |
| Stars | 4.8k |
| Forks | 171 |
| Open issues | 35 |
| Latest release | v1.34.0 (2026-05-02) |
| Last updated | 2026-06-18 |
| Source | https://github.com/stern/stern |
What stern is
Stern queries the Kubernetes API to stream logs from multiple pods/containers in parallel, applying regex filters to pod names, container names, and log lines. It supports multiple output formats (default, raw, JSON), custom templates, timestamp formatting, and field/label selectors for granular resource targeting.
Get the stern source
Clone the repository and explore it locally.
git clone https://github.com/stern/stern.gitcd stern# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Requires kubeconfig access and appropriate RBAC permissions (get pods, get logs). Verify service account has log read permissions in target namespaces.
- API throttling defaults to client-go behavior; tune --qps and --burst flags if hitting API rate limits during high-scale tailing (many pods/containers).
- Output can be piped or templated; consider shell script wrappers for integration with alerting or log processing pipelines.
- Configuration via YAML file (~/.config/stern/config.yaml) allows team standardization of flags like timestamps, colors, and max-log-requests.
- Container/pod filtering uses regex; complex selection logic (multiple labels, field selectors) may require chained invocations or external filtering.
When to avoid it — and what to weigh
- Requires persistent log storage/indexing — Stern is a real-time tailer, not a log aggregation platform. For long-term log retention, searching, or analysis, use dedicated solutions (ELK, Loki, Datadog).
- Complex log correlation or alerting needed — Stern does not aggregate or correlate logs across services at scale, nor does it support alerting rules. Use centralized logging systems for enterprise-grade observability.
- High-volume logging in large clusters — The API throttling and per-pod request limits may become a bottleneck. Consider log aggregation for production clusters with thousands of pods.
- Non-Kubernetes environments — Stern is tightly coupled to Kubernetes API and resource types. Not applicable for non-K8s platforms.
License & commercial use
Stern is released under Apache License 2.0 (Apache-2.0), a well-established OSI-approved permissive license permitting commercial and proprietary use.
Apache-2.0 is permissive and explicitly permits commercial use, modification, and distribution provided original copyright and license notice are retained. Safe for commercial deployment without license review.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
Stern requires read access to pod logs via Kubernetes API. Audit kubeconfig permissions and RBAC; restrict to least-privilege service accounts. No authentication/TLS customization in CLI flags; relies on kubeconfig config. No secrets-masking or log sanitization features; sensitive data in logs will be visible.
Alternatives to consider
kubectl logs (native)
Built-in kubectl command; requires manual pod enumeration and sequential tailing. No regex filtering or color coding. Lightweight but labor-intensive for multi-pod scenarios.
Lens IDE / k9s
GUI-based Kubernetes dashboards with integrated log viewers. Better for exploratory debugging but less suitable for automation and CI/CD pipelines.
Fluentd / Filebeat + ELK/Loki
Centralized log aggregation platforms. Required for long-term retention, full-text search, and cross-service correlation. Significantly more complex infrastructure.
Build on stern with DEV.co software developers
Stern accelerates log troubleshooting in Kubernetes environments. Install via Krew, Homebrew, or direct download and start tailing multiple pods instantly.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
stern FAQ
Does Stern store or persist logs?
Can I filter logs by content, not just pod/container?
What RBAC permissions are required?
Can Stern integrate with my CI/CD pipeline?
Software development & web development with DEV.co
Adopting stern is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source devops software in production.
Ready to streamline your Kubernetes debugging?
Stern accelerates log troubleshooting in Kubernetes environments. Install via Krew, Homebrew, or direct download and start tailing multiple pods instantly.