|Project Name||Stars||Downloads||Repos Using This||Packages Using This||Most Recent Commit||Total Releases||Latest Release||Open Issues||License||Language|
|Kubetail||2,830||2 months ago||32||apache-2.0||Shell|
|Bash script to tail Kubernetes logs from multiple pods at the same time|
|Kail||1,703||1||2||3 days ago||28||June 02, 2021||23||mit||Go|
|kubernetes log viewer|
|Stern||1,542||1||12 days ago||25||December 15, 2021||17||apache-2.0||Go|
|⎈ Multi pod and container log tailing for Kubernetes -- Friendly fork of https://github.com/wercker/stern|
|Ktail||221||a month ago||8||October 03, 2022||mit||Go|
|A tool to easily tail Kubernetes container logs|
|K8stail||137||6 days ago||14||March 05, 2022||8||mit||Go|
|tail -f experience for Kubernetes Pods|
|Kube Gelf||59||3 years ago||3||mit||Dockerfile|
|CoreOS Kubernetes logging to Graylog|
|Ktail||32||6 months ago||2||gpl-2.0||Rust|
|Kubernetes log viewer|
|Kube Log Tail||15||5 years ago||5||apache-2.0||Go|
|Deprecated. I now use https://github.com/wercker/stern|
|Kt||13||a month ago||mit||Go|
|yet another pods log tailer for kubernetes|
|Kubefx||12||6 years ago||apache-2.0||Java|
Bash script that enables you to aggregate (tail/follow) logs from multiple pods into one stream.
This is the same as running "kubectl logs -f
Just download the kubetail file (or any of the releases) and you're good to go.
You can also install kubetail using brew:
$ brew tap johanhaleby/kubetail && brew install kubetail
It's also possible to install kubetail abbreviated to
kt by using the
$ brew tap johanhaleby/kubetail && brew install kubetail --with-short-names
Note that you may need to run
compinit for zsh to pick-up the changes in competition after having upgraded from the non abbreviated installation.
brew install --HEAD kubetail to install the latest (unreleased) version.
You can install kubetail using the asdf version manager.
asdf plugin-add kubetail https://github.com/janpieper/asdf-kubetail.git asdf install kubetail <version>
To find out the available versions to install, you can run the following command:
asdf list-all kubetail
If you're using a ZSH plugin manager, you can install
kubetail as a plugin.
If you're using Antigen:
antigen bundle johanhaleby/kubetailto your
.zshrcwhere you've listed your other plugins.
antigen bundle johanhaleby/kubetailin a running shell to have
antigenload the new plugin.
If you're using oh-my-zsh:
In the command line, change to oh-my-zsh's custom plugin directory :
Clone the repository into a new
git clone https://github.com/johanhaleby/kubetail.git kubetail
~/.zshrc and add
kubetail – same as clone directory – to the list of plugins to enable:
plugins=( ... kubetail )
Then, restart your terminal application to refresh context and use the plugin. Alternatively, you can source your current shell configuration:
If you're using zgen:
zgen load johanhaleby/kubetailto your
.zshrcalong with your other
zgen reset && zgen save
The easiest option is to install kubetail from homebrew to dynamically display the pods names on
$ kubetail <tab>. Alternatively install any of the completion scripts (bash/zsh/fish) manually. For example:
Don't forget to restart your terminal afterwards.
First find the names of all your pods:
$ kubectl get pods
This will return a list looking something like this:
NAME READY STATUS RESTARTS AGE app1-v1-aba8y 1/1 Running 0 1d app1-v1-gc4st 1/1 Running 0 1d app1-v1-m8acl 1/1 Running 0 6d app1-v1-s20d0 1/1 Running 0 1d app2-v31-9pbpn 1/1 Running 0 1d app2-v31-q74wg 1/1 Running 0 1d my-demo-v5-0fa8o 1/1 Running 0 3h my-demo-v5-yhren 1/1 Running 0 2h
To tail the logs of the two "app2" pods in one go simply do:
$ kubetail app2
To tail only a specific container from multiple pods specify the container like this:
$ kubetail app2 -c container1
You can repeat
-c to tail multiple specific containers:
$ kubetail app2 -c container1 -c container2
To tail multiple applications at the same time seperate them by comma:
$ kubetail app1,app2
For advanced matching you can use regular expressions:
$ kubetail "^app1|.*my-demo.*" --regex
To tail logs within a specific namespace, make sure to append the namespace flag after you have provided values for containers and applications:
$ kubetail app2 -c container1 -n namespace1
-h for help and additional options:
$ kubetail -h
By using the
-k argument you can specify how kubetail makes use of colors (only applicable when tailing multiple pods).
|pod||Only the pod name is colorized but the logged text is using the terminal default color|
|line||The entire line is colorized (default)|
|false||Don't colorize the output at all|
$ kubetail app2 -k false
If you find that some colors are difficult to see then they can be skipped by supplying the color index either to the
-z flag or by setting the
KUBETAIL_SKIP_COLORS environment variable (either choice could be comma seperated). To find the color index you'd like to skip more easily, set the
-i flag to
-i true) or set the
KUBETAIL_SHOW_COLOR_INDEX environment variable to
KUBETAIL_SHOW_COLOR_INDEX=true). This will print the color index as a prefix to the pod name (e.g.
[3:my-pod-12341] some log where
3 is the index of the color). This is also helpful if you suffer from color blindness since the index will always be printed with the default terminal color.
kubetail itself doesn't have filtering or highlighting capabilities built-in. If you're on MacOSX I recommend using iTerm2 which allows for continuous highlighting of search terms, good scrolling capabilities and multitab arrangements. Another useful feature of iTerm2 is the "timeline" (
e) which lets you display a timeline in your own local timezone next to the logs (that are typically in UTC).
If you're not using iTerm2 or think that kubetail is lacking in features there's a fork of kubetail made by Alan Stebbens that allows for richer configuration and uses multitail and bash-lib. Alan has been kind enough to provide a pull request but my current thinking is that I'd like kubetail to stay simple and small and not use any dependencies.
kubetail can take default option values from environment variables matching the option name.
KUBETAIL_PREVIOUS KUBETAIL_SINCE KUBETAIL_NAMESPACE KUBETAIL_FOLLOW KUBETAIL_PREFIX KUBETAIL_LINE_BUFFERED KUBETAIL_COLORED_OUTPUT KUBETAIL_TIMESTAMPS KUBETAIL_JQ_SELECTOR KUBETAIL_SKIP_COLORS KUBETAIL_TAIL KUBETAIL_SHOW_COLOR_INDEX
Pull requests are very welcome!
See also: http://code.haleby.se/2015/11/13/tail-logs-from-multiple-pods-simultaneously-in-kubernetes/