This project is meant to be used in the pipeline with tools like kubectl
.
The goals of this projects are simple:
- Pretty print valid JSON strings received from
kubectl
or any other tool. - Print non-valid JSON strings or strings which doesn't contain JSON at all "as is".
- Join multi-line JSON messages which were split by
php-fpm
or any other tool adding limits for a line length and pretty print these too.
Project can be easily built with this command:
go build
After go build
, you can use this tool in the pipeline:
kubectl -n ... logs ... | <path-to-project>/json-formatter
Add alias or shortcut if needed.