stern /stern

⎈ Multi pod and container log tailing for Kubernetes

★ 4,924⑂ 181👁 24⑃ 226● 167▤ 28
GoApache-2.0Created 2020-10-21
Download: v1.35.0v1.35.0 ↓1.35.02026-10-22
+2
Daily
4,924
stars
181
forks
24
watchers
226
prs
167
issues
28
releases

README

stern

Fork of discontinued wercker/stern

Stern allows you to tail multiple pods on Kubernetes and multiple containers
within the pod. Each result is color coded for quicker debugging.

The query is a regular expression or a Kubernetes resource in the form
 / so the pod name can easily be filtered and
you don't need to specify the exact id (for instance omitting the deployment
id). If a pod is deleted it gets removed from tail and if a new pod is added it
automatically gets tailed.

When a pod contains multiple containers Stern can tail all of them too without
having to do this manually for each one. Simply specify the container flag to
limit what containers to show. By default all containers are listened to.

 Installation

 Download binary

Download a binary release

 Build from source


go install github.com/stern/stern@latest


 asdf (Linux/macOS)

If you use asdf, you can install like this:

asdf plugin add stern
asdf install stern latest


 Homebrew (Linux/macOS)

If you use Homebrew, you can install like this:

brew install stern


 Krew (Linux/macOS/Windows)

If you use Krew which is the package manager for kubectl plugins, you can install like this:

kubectl krew install stern


 WinGet (Windows)

If you're running on Windows, usually the actual best way is to use WinGet to install which is Windows' built-in package manager, you can install like this:

winget install stern.stern


 Usage


stern pod-query [flags]


The pod-query is a regular expression or a Kubernetes resource in the form /.

The query is a regular expression when it is not a Kubernetes resource,
so you could provide "web-\w" to tail web-backend and web-frontend pods but not web-123.

When the query is in the form / (exact match), you can select all pods belonging
to the specified Kubernetes resource, such as deployment/nginx.
Supported Kubernetes resources are pod, replicationcontroller, service, daemonset, deployment,
replicaset, statefulset and job. The resource type can also be qualified with its API group,
as kubectl get -o name prints it (e.g. deployment.apps/nginx or job.batch/migrate).

 cli flags


 flag                        | default                       | purpose
-----------------------------|-------------------------------|---------
 --all-namespaces, -A    | false                       | If present, tail across all namespaces. A specific namespace is ignored even if specified with --namespace.
 --burst                   | 0                           | Maximum burst for throttle to the Kubernetes API server. Defaults to 0 (use client-go default). Ignored when --qps=-1.
 --color                   | auto                        | Force set color output. 'auto':  colorize if tty attached, 'always': always colorize, 'never': never colorize.
 --completion              |                               | Output stern command-line completion code for the specified shell. Can be 'bash', 'zsh' or 'fish'.
 --condition               |                               | Th

Top issues

Discussions

Latest release

v1.35.0 v1.35.0 2026-10-22
:zap: Notable Changes

 A new --pager flag to pipe output into a pager

You can now pipe stern's output into a pager with the --pager flag. Unlike piping in the shell (stern --color=always backend | less -R), colors are preserved without any extra flags, and stern stops tailing when you quit the pager.


stern --pager less backend


The pager is used only when the standard output is connected to a terminal (tty). If you always want to use a pager, set it in the config file:

yaml
pager: less


 Distinct colors for pods created by the same workload

Pods created by the same wo

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON