A collection of scripts for troubleshooting and parsing data.
Collects logs from all pods in a Kubernetes namespace, with support for multi-container pods, init containers, and previous container logs (after restarts).
# Basic usage - will prompt for namespace
./collect-k8s-logs.sh
# Specify namespace and time range
./collect-k8s-logs.sh -n airbyte --since 1h
# Filter by label selector
./collect-k8s-logs.sh -n airbyte -l "app=airbyte,component=worker"
# Create compressed archive for sharing
./collect-k8s-logs.sh -n airbyte --since 2h --tgz --rmOptions:
| Flag | Description |
|---|---|
-n, --namespace |
Kubernetes namespace |
-o, --out |
Output directory (default: ./logs/<namespace>_<timestamp>) |
--since |
Log duration: 5s, 2m, 3h, 7d |
-l, --selector |
Label selector to filter pods |
--gzip |
Gzip individual log files |
--tgz |
Create a .tar.gz archive |
--rm |
Remove original directory after archiving (with --tgz) |
Formats multi-line Airbyte sync log blocks into single lines for easier terminal viewing and grep-ability.
# Interactive
python3 flatten_sync_logs.py
# From file
python3 flatten_sync_logs.py sync_logs.txt
Parses Airbyte Cloud credit export CSVs, splitting the Credits column (e.g., 1.5 $1,234.56) into separate numeric Credits and Monetary columns.
python3 parse_credits.py export.csvOutput is written to processed_file.csv in the same directory as the input.
Spins up a fresh Postgres container and restores the database dump for local inspection.
cd pgdumprestore
./restore-airbyte-db.sh database.dumpAfter restore, connect with:
psql -h localhost -p 5433 -U postgres -d db-airbyteRequires: Docker
Environment:
PGDUMP_PASSWORD- Postgres password (default:postgres)
kubectlconfigured with cluster access (forcollect-k8s-logs.sh)- Python 3.x (for Python scripts)
- Docker (for
pgdumprestore)