Pipe your structured JSON logs through un and get something you can actually read.
No config, no flags — just pipe and go.
go install github.com/yavosh/un@latest# read from a file
cat app.log | un
# tail Kubernetes pods
stern my-app -o raw --tail 0 | un
# follow a log file
tail -f /var/log/app.json | un
# follow kubectl logs
kubectl logs -f deployment/my-app | un
# pipe from docker
docker logs -f my-container 2>&1 | unun reads JSON log lines from stdin and prints them as color-coded, human-friendly output.
Before:
{"level":"INFO","time":"2024-10-25T10:38:42.796872+03:00","msg":"Shut down HTTP","service":"api","duration":0.23}After:
[ INFO] 10:38:42 Shut down HTTP service=api duration=0.23
- Color-coded log levels — INFO, WARN, ERROR, DEBUG each get their own color
- Automatic timestamp parsing — RFC3339, unix milliseconds, and many other formats
- Color-coded attributes — extra fields are displayed as
key=valuepairs with consistent per-key colors - Non-JSON passthrough — lines that aren't JSON are printed as-is
- Works with common field names —
level/severity,msg/message,time/timestamp/@timestamp/ts, and more