Retrieve and manage kubernetes pod logs with filtering & highlighting
MIT License
plogs
is a kubernetes plugin that facilitates retrieving logs from Kubernetes pods with various filtering and highlighting options. It allows users to specify the namespace, container name, labels, and mark specific words for highlighting within the logs stream.
You can install the "plogs" plugin using krew
kubectl krew install plogs
Bash Install Script
By default, plogs is going to be installed at /usr/bin/
. sudo
privileges are required for this operation.
If you would like to provide a custom install path, you can do so as an input to the script.
For example, you can run ./install.sh $HOME/bin
to install plogs in the specified directory.
curl -sL https://bit.ly/installplogs | sudo sh
OR
curl -s https://raw.githubusercontent.com/kha7iq/plogs/main/install.sh | sudo sh
# DEB
export PLOGS_VERSION="0.1.1"
wget -q https://github.com/kha7iq/plogs/releases/download/v${PLOGS_VERSION}/plogs_amd64.deb
sudo dpkg -i plogs_amd64.deb
# RPM
sudo rpm -i plogs_amd64.rpm
# Chose desired version
export PLOGS_VERSION="0.1.1"
wget -q https://github.com/kha7iq/plogs/releases/download/v${PLOGS_VERSION}/plogs_linux_amd64.tar.gz && \
tar -xf plogs_linux_amd64.tar.gz && \
chmod +x plogs && \
sudo mv plogs /usr/bin/kubectl-plogs
--mark, -m
--mark <word>
-m
--namespace, -n
--namespace <namespace>
-n
--container, -c
--container <containerName>
-c
--label, -l
--label <labels>
-l
--pod, -p
--pod <podName>
-p
--follow, -f
--follow
-f
--tail, -t
--tail <lines>
-t
Consider adding this alias to your .bashrc
or .zshrc
for convenience.
echo "alias kpl='kubectl plogs'" >> .bashcr
echo "alias kplf='kubectl plogs -f'" >> .bashrc
kpl -n dev -l app=myapp -m "fail" -p my-pod -t 10
kplf -n dev -p my-pod -t 10
If you encounter any problems or have suggestions for improvements, please open an issue on GitHub.
Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.