stern
Command-line tool that tails logs from multiple Kubernetes pods and containers at once, with color-coded output and regex filtering.
Tested on Linux
Use it
Linux x86_64
These steps ran from a folder named work in the home folder, which already existed. Make it and run them from there:
mkdir -p "$HOME/work" && cd "$HOME/work"Download stern v1.35.0 linux_amd64 release tarball, extract, install into ~/.local/bin
cd /tmp && TAG=$(curl -fsSLI -o /dev/null -w '%{url_effective}' https://github.com/stern/stern/releases/latest | sed 's#.*/tag/##') && V=${TAG#v} && curl -fsSLO https://github.com/stern/stern/releases/download/$TAG/stern_${V}_linux_amd64.tar.gz && tar xzf stern_${V}_linux_amd64.tar.gz && mkdir -p ~/.local/bin && install -m755 stern ~/.local/bin/stern
Verified in pickfit: the commands exactly as its sandbox ran them
For the record only: they name the sandbox's home, /home/sbx.
cd /tmp && TAG=$(curl -fsSLI -o /dev/null -w '%{url_effective}' https://github.com/stern/stern/releases/latest | sed 's#.*/tag/##') && V=${TAG#v} && curl -fsSLO https://github.com/stern/stern/releases/download/$TAG/stern_${V}_linux_amd64.tar.gz && tar xzf stern_${V}_linux_amd64.tar.gz && mkdir -p ~/.local/bin && install -m755 stern ~/.local/bin/sternstern --versioncat > /home/sbx/work/service.log <<'EOF'
{"level":"info","msg":"server started","port":8080}
{"level":"error","msg":"db connection failed"}
plain text line: request handled
EOFstern --stdin < service.logCheck that it works
stern --versionThe output should contain “version: 1.35.0”.
First thing to try
cat > "$HOME"/work/service.log <<'EOF'
{"level":"info","msg":"server started","port":8080}
{"level":"error","msg":"db connection failed"}
plain text line: request handled
EOFstern --stdin < service.logRun stern --stdin < <file> to read log lines from a file, or point it at your Kubernetes cluster to tail pod logs.
What it does
- See log output in colorTested
How to use it
- Add
--color=alwaysand a color function in the template, for examplestern --stdin --color=always --template='{{ colorRed .Message }}{{"\n"}}' < <file>.
- Add
- Format log lines with your own Go templatesTested
How to use it
- Pass a Go template with
--template, for example `stern --stdin --template='{{ with $msg := .Message | tryParseJSON }}[{{ $msg.level }}] {{ $msg.msg }}{{ else }}RAW: {{ .Message }}{{ end }}{{"\n"}}' - Use
tryParseJSONto read fields from JSON log lines and fall back to the raw message for plain lines.
- Pass a Go template with
- Tail logs from many pods and containers at onceNot tested
- Pick pods by regex or resource nameNot tested
How far pickfit got
Linux x86_64
- Installs
- Starts
- 2 of 4 features work
- Works offline
macOS and Windows: the project says it runs there; pickfit hasn’t tried it.
Good for
- tail logs from all pods across all namespaces
- tail pods created by a deployment
- pipe Kubernetes logs as JSON to jq
- show logs only for pods that are not ready
How pickfit tested it
Each run starts from a clean machine and follows the steps above. How pickfit verifies
Linux x86_64
Its main function works
- Replayed from scratch
- Works offline
- Checked on 15 Nov 2026
- Version 1.35.0
Differences the test machine hit
- README: go install github.com/stern/stern@latest / asdf / krew
In the test: The box has no Go, asdf or krew, so I used the README's 'Download a binary release' option: stern_1.35.0_linux_amd64.tar.gz from GitHub releases, extracted into ~/.local/bin - README: stern --stdin < service.log
In the test: The README provides no service.log; I wrote a small sample log file myself