{"id":24308919,"url":"https://github.com/frobware/kat","last_synced_at":"2025-12-06T08:02:23.319Z","repository":{"id":270877370,"uuid":"911728714","full_name":"frobware/kat","owner":"frobware","description":"Streams logs from all containers in specified Kubernetes namespaces in real-time.","archived":false,"fork":false,"pushed_at":"2025-01-28T13:37:47.000Z","size":6224,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T01:43:09.608Z","etag":null,"topics":["container","kubernetes","logs","pod","tail"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frobware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-03T17:49:51.000Z","updated_at":"2025-01-28T13:37:52.000Z","dependencies_parsed_at":"2025-01-03T18:39:22.450Z","dependency_job_id":"06419fff-65d2-42db-be2d-c7ac7a9cca87","html_url":"https://github.com/frobware/kat","commit_stats":null,"previous_names":["frobware/kat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fkat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fkat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fkat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Fkat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frobware","download_url":"https://codeload.github.com/frobware/kat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242277694,"owners_count":20101545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container","kubernetes","logs","pod","tail"],"created_at":"2025-01-17T05:11:55.610Z","updated_at":"2025-12-06T08:02:23.313Z","avatar_url":"https://github.com/frobware.png","language":"Go","readme":"# kat - Real-time Log Streaming for Kubernetes\n\n`kat` (Kubernetes Attach \u0026 Tail Pod Logs) streams logs from all containers across namespaces in real-time. It supports glob patterns for namespace matching and automatically discovers new pods.\n\n```sh\n# Stream logs from your frontend namespace\nkat frontend\n\n# Stream from multiple namespaces with patterns\nkat frontend backend go-*\n\n# Stream from all namespaces (requires cluster-wide permissions)\nkat -A\n\n# Exclude development namespaces\nkat -A --exclude \"*-dev\"\n```\n\n## Namespace Patterns\n\n`kat` supports glob patterns for namespace matching:\n\n- `*` matches any sequence of characters\n- `?` matches any single character\n- `[abc]` matches any character in the set\n\nExamples:\n- `kat go-*` matches `go-service`, `go-backend`\n- `kat test-?` matches `test-1`, `test-a` but not `test-10`\n- `kat app-[123]` matches `app-1`, `app-2`, `app-3`\n\nThe `--exclude` flag uses the same patterns and can be repeated or comma-separated.\n\n## Container Patterns\n\n`kat` also supports glob patterns for container name matching using the `-c` flag:\n\n- `*` matches any sequence of characters\n- `?` matches any single character  \n- `[abc]` matches any character in the set\n\nExamples:\n- `kat -c \"app-*\" frontend` matches `app-server`, `app-worker`, `app-cache`\n- `kat -c \"init-?\" backend` matches `init-1`, `init-a` but not `init-10`  \n- `kat -c \"*-sidecar\" production` matches `istio-sidecar`, `logging-sidecar`\n\n## Quick Start\n\n1. Install:\n   ```sh\n   go install github.com/frobware/kat/cmd/kat@latest\n   ```\n\n2. Run:\n   ```sh\n   # Stream all logs from current namespace\n   kat\n\n   # Stream from specific namespaces\n   kat frontend backend\n\n   # Stream with patterns\n   kat go-* frontend-*\n\n   # Stream and save logs to disk\n   kat -d frontend  # Creates timestamped directory in /tmp\n   ```\n\n## Basic Usage\n\n### Stream logs to console\n```sh\n# Single namespace\nkat frontend\n\n# Multiple namespaces\nkat frontend backend\n\n# Glob patterns\nkat go-* frontend-*\n\n# All namespaces\nkat -A\n\n# Exclude patterns\nkat -A --exclude \"*-dev\" --exclude \"kube-*\"\n```\n\n### Filter by container names\n```sh\n# Stream logs from specific containers only\nkat -c nginx frontend\n\n# Multiple containers\nkat -c nginx -c sidecar frontend backend\n\n# Comma-separated container names\nkat -c \"nginx,sidecar,init-container\" frontend\n\n# Container glob patterns\nkat -c \"app-*\" frontend          # Match app-server, app-worker, etc.\nkat -c \"*-sidecar\" backend        # Match istio-sidecar, logging-sidecar\nkat -c \"init-?\" frontend          # Match init-1, init-a, etc.\n\n# Combine namespace and container filtering\nkat -A -c nginx --exclude \"kube-*\"\nkat go-* -c \"app-*\" -c \"worker-*\"   # Stream from go-* namespaces, app-* and worker-* containers\n```\n\n### Save logs to disk\n```sh\n# Auto-create timestamped directory\nkat -d frontend\n→ Using temporary log directory: /tmp/kat-2025-01-06T15:30:00\n\n# Specify output directory\nkat --tee /tmp/my-logs frontend\n\n# Save logs but hide console output\nkat --tee /tmp/logs --silent frontend\n```\n\n## Directory Structure\n\nWhen saving logs (using `-d` or `--tee`), `kat` creates this structure:\n```\n/output-dir/\n  └── namespace/\n      └── pod-name/\n          └── container-name.txt\n```\n\n## Common Options\n\nFlag | Description | Default\n---|---|---\n`-A` | Watch all namespaces | false\n`--exclude` | Exclude namespace patterns (repeatable) | -\n`-c` | Filter by container name patterns (repeatable) | - \n`--since duration` | Show logs from last N minutes | 1m\n`-d` | Auto-create temporary directory in /tmp | -\n`--tee string` | Write logs to specified directory | -\n`--silent` | Disable console output | false\n`--allow-existing` | Allow writing to existing directory | false\n\n## Advanced Configuration\n\nFor high-throughput clusters or specific requirements:\n\nFlag | Description | Default\n---|---|---\n`--qps float` | Kubernetes client QPS | 500\n`--burst int` | Kubernetes client burst rate | 1000\n`--kubeconfig string` | Path to kubeconfig | ~/.kube/config\n\n## How It Works\n\n```\n┌──────────┐    ┌───────────┐    ┌──────────┐\n│  Pod 1   │    │           │    │ Console  │\n│ Container├────┤           ├────┤          │\n│ Logs     │    │    kat    │    │          │\n├──────────┤    │           │    ├──────────┤\n│  Pod 2   │    │ Automatic │    │          │\n│ Container├────┤ Discovery ├────┤  Files   │\n│ Logs     │    │    \u0026      │    │          │\n├──────────┤    │ Streaming │    │          │\n│   ...    │    │           │    │          │\n└──────────┘    └───────────┘    └──────────┘\n```\n\n`kat` uses Kubernetes informers to watch for pod lifecycle events, automatically attaching to new pods and detaching from terminated ones. When using glob patterns or the `-A` flag, it watches for namespace changes and starts streaming from matching namespaces as they appear.\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrobware%2Fkat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrobware%2Fkat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrobware%2Fkat/lists"}