{
  "id": "collect-logs",
  "title": "Collect logs",
  "url": "https://redis.io/docs/latest/operate/kubernetes/7.8.6/logs/collect-logs/",
  "summary": "Run the log collector script to package relevant logs into a tar.gz file to send to Redis Support for help troubleshooting your Kubernetes environment.",
  "content": "\nThe Redis Enterprise cluster (REC) log collector script ([`log_collector.py`](https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/log_collector/log_collector.py)) creates and fills a directory with the relevant logs for your environment. These logs will help the support team with troubleshooting.\n\nAs of version 6.2.18-3, the log collector tool has two modes:\n\n- **restricted** collects only resources and logs created by the operator and Redis Enterprise deployments\n  - This is the default for versions 6.2.18-3 and later\n- **all** collects everything from your environment\n  - This is the default mode for versions 6.2.12-1 and earlier\n\n This script requires Python 3.6 or later. \n\n1. Download the latest [`log_collector.py`](https://github.com/RedisLabs/redis-enterprise-k8s-docs/blob/master/log_collector/log_collector.py) file.\n\n1. Have a K8s administrator run the script on the system that runs your `kubectl` or `oc` commands.\n    - Pass `-n` parameter to run on a different namespace than the one you are currently on\n    - Pass `-m` parameter to change the log collector mode (`all` or `restricted`)\n    - Run with `-h` to see more options\n\n    ```bash\n    python log_collector.py \n    ```\n\n    If you get an error because the yaml module is not found, install the pyYAML module with `pip install pyyaml`.\n  \n\n\n\n1. Upload the resulting `tar.gz` file containing all the logs to [Redis Support](https://support.redislabs.com/).\n",
  "tags": ["docs","operate","kubernetes"],
  "last_updated": "2026-04-01T08:10:08-05:00"
}

