An open API service indexing awesome lists of open source software.

https://github.com/umegbewe/kubectl-multilog

Stream tailed logs across containers, pods and clusters
https://github.com/umegbewe/kubectl-multilog

kubectl kubectl-plugin kubectl-plugins kubernetes

Last synced: about 1 year ago
JSON representation

Stream tailed logs across containers, pods and clusters

Awesome Lists containing this project

README

          

# kubectl-multilog

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

## Demo

[![asciicast](https://asciinema.org/a/593139.svg)](https://asciinema.org/a/593139)

## 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:

```bash
go build -o kubectl-multilog
```

Move the binary to a directory in your `PATH`, you might need to run this with sudo
```bash
mv kubectl-multilog /usr/local/bin
```

## Usage
Here's how to use the :

``kubectl multilog --help``

```
--kubeconfig --context --namespace --selector --init-containers --previous
```

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](https://github.com/umegbewe/kubectl-multilog/blob/main/README.md).