LinuxCommandLibrary

kubetail

tails logs from multiple pods simultaneously

TLDR

Tail pod logs

$ kubetail [pod-name-pattern]
copy
Tail with label
$ kubetail -l [app=myapp]
copy
Tail in namespace
$ kubetail [pattern] -n [namespace]
copy
Tail specific container
$ kubetail [pattern] -c [container]
copy
Follow with timestamps
$ kubetail [pattern] -t
copy
Colored output
$ kubetail [pattern] -k [pod]
copy

SYNOPSIS

kubetail [options] pattern

DESCRIPTION

kubetail is a bash script that aggregates and tails log output from multiple Kubernetes pods simultaneously. It matches pods by name pattern or label selector and streams their logs in a single terminal, using color-coded output to visually distinguish which lines come from which pod.
The tool is especially useful when debugging distributed applications or microservices where relevant log entries are spread across several pod replicas. It supports filtering by namespace, targeting specific containers within multi-container pods, and displaying timestamps alongside log lines. Under the hood, kubetail spawns multiple `kubectl logs --follow` processes and merges their output.

PARAMETERS

PATTERN

Pod name pattern.
-l SELECTOR
Label selector.
-n NAMESPACE
Target namespace.
-c CONTAINER
Container name.
-t
Show timestamps.
-k FIELD
Color by field.
--help
Display help information.

CAVEATS

Third-party tool. Bash script. Requires kubectl.

HISTORY

kubetail was created to simplify tailing logs from multiple Kubernetes pods with a single command.

SEE ALSO

kubectl(1), stern(1), k9s(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community