Tail and diff structured JSON logs across multiple services in real time.
go install github.com/yourusername/logdrift@latestOr build from source:
git clone https://github.com/yourusername/logdrift.git
cd logdrift
go build -o logdrift .Tail logs from multiple services and highlight structural differences as they arrive:
logdrift --services auth-service,payment-service --field level,message,trace_idPipe from log files or streams:
logdrift --input ./logs/auth.log ./logs/payment.log --diff-keys timestamp,errorExample output:
[auth-service] {"level":"error","message":"token expired","trace_id":"abc123"}
[payment-service] {"level":"info","message":"charge processed","trace_id":"abc123"}
^^^ DRIFT: level mismatch — error vs info
| Flag | Description |
|---|---|
--services |
Comma-separated list of service names to tail |
--input |
One or more log file paths to read from |
--field |
JSON fields to compare across services |
--follow |
Keep tailing as new log lines arrive (default: true) |
--format |
Output format: pretty, json, or compact |
- Go 1.21+
- Services must emit newline-delimited JSON logs
MIT © 2024 yourusername