Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

un

Pipe your structured JSON logs through un and get something you can actually read.

No config, no flags — just pipe and go.

Install

go install github.com/yavosh/un@latest

Usage

# 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 | un

What it does

un 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

Features

  • 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=value pairs 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

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages