This article provides an overview of the Log Grabber. Log Grabber is a utility script that streamlines the process of collecting logs and diagnostics from Kubernetes-based meshIQ environments. Instead of manually retrieving logs from multiple pods and components, Log Grabber automates the entire process—gathering both standard pod logs and additional diagnostic files stored within the file system of meshIQ components.
It packages everything into a single archive, making it easier to troubleshoot issues, share details with support teams, and accelerate root cause analysis in complex, multi-component deployments.
Why Use Log Grabber?
While kubectl logs can capture standard output and error streams (STDOUT/STDERR), some critical logs aren't available via this command. The Log Grabber script captures:
- Pod logs via
kubectl logs - Additional log files stored inside the pod's file system
These logs are bundled into a compressed .tar.gz archive, making it easy to review locally or share with support.
How It Works
The script performs the following steps:
- Connects to your cluster and reads the list of meshIQ pods.
- Captures pod logs using
kubectl logs. - Copies internal log files from each pod’s file system.
- Bundles all logs into a
.tar.gzarchive stored on a temporary pod. - Transfers the archive to your local machine (same directory where you run the script).
- Cleans up all resources it created on the cluster (Job, ServiceAccount, ClusterRole, ClusterRoleBinding).
Pre-requisites
To use the Log Grabber:
- You must be running meshIQ on a Kubernetes cluster deployed via Helm.
- You must have admin access or permission to apply manifests on the cluster.
What the Script Deploys
- ServiceAccount, ClusterRole, and ClusterRoleBinding
- Grants permission to list/get pods, access logs, and execute commands inside pods.
- Job
- Uses the ServiceAccount to collect logs and bundle them into an archive.
The script waits for the job to complete, downloads the archive to your local system, and then deletes all temporary Kubernetes resources used during the process.
How to Use the Log Grabber
- Download the script:
log-grabber.sh - Make it executable:
chmod +x ./log-grabber.sh
Run the script:
If your meshIQ platform is in the default namespace:./log-grabber.sh
To specify a different namespace (e.g.,
meshiq-blue):./log-grabber.sh meshiq-blue
Your current Kubernetes context must be set to the cluster where meshIQ is deployed for the script to function correctly.