Skip to content

Stream tailed logs across containers, pods and clusters

License

Notifications You must be signed in to change notification settings

umegbewe/kubectl-multilog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubectl-multilog

CLI tool for real-time streaming of logs from multiple Kubernetes pods.

Demo

asciicast

Features

  • Real-time streaming of logs from selected pods and containers.
  • Fetch logs across multiple clusters
  • Color-coding to differentiate logs from different pods/containers.
  • Fetch logs based on timestamps (sinceSeconds or sinceTime).
  • Supports logs from init containers.

Building

To build kubectl-multilog, you need Go installed on your machine. You can then build the binary using the following command:

go build -o kubectl-multilog

Move the binary to a directory in your PATH, you might need to run this with sudo

mv kubectl-multilog /usr/local/bin

Usage

Here's how to use the :

kubectl multilog --help

--kubeconfig <kubeconfig_path> --context <kubernetes,context> --namespace <namespace> --selector <label_selector> --init-containers <bool> --previous <bool>

Options:

kubeconfig: Path to the kubeconfig file. Defaults to ~/.kube/config.

context: Optional, seperated by commas

namespace: Kubernetes namespace to use. Defaults to default.

selector: Label selector to filter the pods.

init-containers: Whether to include init containers. Defaults to false.

previous: Whether to include previous terminated containers. Defaults to false.

container: Specific container to fetch logs from within a pod.

since: Fetch logs since a specific point in time or duration (e.g., 5m for last five minutes).

Contributing

Contributions are welcome! Please submit a pull request or create an issue to contribute to this project.

License

This project is licensed under the MIT License.

About

Stream tailed logs across containers, pods and clusters

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages