whatisgithub

What is stern?

stern/stern — explained in plain English

Analysis updated 2026-06-26

4,681GoAudience · ops devopsComplexity · 2/5Setup · easy

In one sentence

Stern is a command-line tool that streams logs from multiple Kubernetes pods and containers simultaneously in one terminal window, with color-coded output and filters so you stop juggling separate log commands per pod.

Mindmap

mindmap
  root((stern))
    What it does
      Multi-pod log tail
      Color-coded output
      Auto-detect new pods
      Regex filtering
    Output formats
      Plain text
      JSON
      Custom template
    Install options
      Homebrew
      WinGet
      Krew
      Binary download
    Filters
      Pod name pattern
      Namespace
      Container name
      Log content regex
    Audience
      Kubernetes operators
      DevOps engineers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Tail logs from all pods in a Kubernetes deployment at once with color-coded output to tell them apart at a glance.

USE CASE 2

Filter live pod log output to lines matching a pattern while piping the rest into jq or another log processor.

USE CASE 3

Automatically pick up logs from newly started or replaced pods without restarting the watch command.

What is it built with?

GoKubernetes

How does it compare?

stern/sterndeckarep/golang-setwerf/werf
Stars4,6814,6794,684
LanguageGoGoGo
Setup difficultyeasyeasyhard
Complexity2/52/54/5
Audienceops devopsdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires kubectl configured with access to a Kubernetes cluster, no additional setup needed after installation.

So what is it?

Stern is a command-line tool for reading log output from applications running in Kubernetes. In Kubernetes, applications run inside units called pods, and a pod can contain multiple containers. The built-in Kubernetes tools let you read logs from one container at a time, which becomes tedious when you are trying to follow what is happening across many pods at once. Stern solves this by letting you tail logs from multiple pods and containers simultaneously in a single terminal window. You identify which pods to watch by giving Stern a search pattern. This can be a regular expression matching pod names, or a reference to a Kubernetes resource like a deployment or a job, and Stern will automatically find all the pods that belong to it. If a pod is replaced or a new one starts, Stern picks it up automatically without you needing to restart the command. Each pod and container gets a different color in the output so you can tell them apart at a glance. The tool has a wide range of filtering options. You can limit output to logs matching a certain pattern, exclude lines you do not care about, filter by which containers are running or which namespace they belong to, and choose how far back in time to pull logs. Output format can be plain text, JSON, or a custom template if you need to pipe the output into another tool. Installation is available through several standard package managers including Homebrew on macOS and Linux, WinGet on Windows, Krew for Kubernetes plugin users, and asdf. You can also download a pre-built binary directly or build it from source using Go. This is a maintained community fork of an older project called wercker/stern, which was discontinued. The license and full README are in the repository.

Copy-paste prompts

Prompt 1
Using stern, show me the command to tail logs from all pods in my api deployment filtered to lines containing ERROR across all namespaces.
Prompt 2
I want to output stern logs as JSON and pipe them into jq to extract only the message field. Write the full command.
Prompt 3
Generate a stern command that watches a Kubernetes job, stops when the job finishes, and saves all output to a file.
Prompt 4
How do I install stern via Krew and set up a shell alias to tail any deployment by name with colored output?

Frequently asked questions

What is stern?

Stern is a command-line tool that streams logs from multiple Kubernetes pods and containers simultaneously in one terminal window, with color-coded output and filters so you stop juggling separate log commands per pod.

What language is stern written in?

Mainly Go. The stack also includes Go, Kubernetes.

How hard is stern to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is stern for?

Mainly ops devops.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.