Skip to Content
March 26, 2025

Announcing Kubetail CLI "logs" command

By Andres Morey

To make it easier to monitor and debug multi-container workloads on Kubernetes, we’ve added a new logs command to the Kubetail CLI tool. With the new logs command you can now grep your Kubernetes workload logs in real-time from your terminal. You can also filter by time and other source properties such as node and zone.

To install the Kubetail CLI tool you can download it from the release page or use homebrew:

brew install kubetail

Here are some examples of what you can do with the new logs command:

# Tail 'web' deployment in the 'default' namespace kubetail logs deployments/web # Tail 'web' deployment in the 'frontend' namespace kubetail logs frontend:deployments/web # Return last 100 records kubetail logs deployments/web --tail=100 # Return first 100 records kubetail logs deployments/web --head=100 # Stream new records kubetail logs deployments/web --follow # Return all records kubetail logs deployments/web --all # Return first 10 records starting from 30 minutes ago kubetail logs deployments/web --since PT30M # Return last 10 records leading up to 30 minutes ago kubetail logs deployments/web --until PT30M # Return first 10 records between two exact timestamps kubetail logs deployments/web --since 2006-01-02T15:04:05Z07:00 --until 2007-01-02T15:04:05Z07:00 # Return last 10 records that match "GET /about" kubetail logs deployments/web --grep "GET /about" --force # Return first 10 records that match "GET /about" kubetail logs deployments/web --grep "GET /about" --head --force # Return last 10 records that match "GET /about" or "GET /contact" kubetail logs deployments/web --grep "GET /(about|contact)" --force # Stream new records that match "GET /about" kubetail logs deployments/web --grep "GET /about" --follow --force

The logs command uses your local kube config file to authenticate with your cluster so to switch clusters just change your kube config context. You can also use the --kube-context flag:

kubetail logs --kube-context minikube deployments/web

One thing you’ll notice is that in order to use --grep you also have to use --force. This is because filtering is done client-side which means the tool will continuously download logs from your cluster until the desired number of matches are found. This could result in unexpectedly large downloads so we added a secondary flag check. We’re working on a new feature to get around this issue.

Please check out the new logs command and let us know what you think!