This is Perl module App::jl.
The jl command allows you to show JSON log nicely. Especially, recursively decoded JSON in JSON string
$ echo '{"foo":"{\"bar\":\"{\\\"baz\\\":123}\"}"}' | jl { "foo" : { "bar" : { "baz" : 123 } } }
A complecated log can be converted to nice JSON structure to treat a tool like jq .
jq
echo '{"service":"Foo-Service","pod":"bar-baz-12345","message":"{\"log\":\"[PID:12345]<info>\\nThis is log message. foo, bar, baz, qux, long message is going to be splitted nicely to treat JSON by jq without any special function\",\"timestamp\":1560526739}"}' | jl -xxxx { "message" : { "log" : [ [ "[PID:12345]", "<info>" ], [ "This is log message. foo", "bar", "baz", "qux", "long message is going to be splitted nicely to treat JSON by jq without any special function" ] ], "timestamp" : "2019-06-15 00:38:59" }, "pod" : "bar-baz-12345", "service" : "Foo-Service" }
Make JSON logs more readable.
There are several ways to install,
1) The easiest way to install App::jl is
$ curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n App::jl
2) If your cpanm (cpm or CPAN) is set up, you should just be able to do
$ cpanm App::jl
3) Clone it, then build it
$ perl Makefile.PL $ make # make install
App::jl is hosted on github http://github.com/bayashi/App-jl
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
Dai Okabayashi <bayashi@cpan.org>
To install App::jl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::jl
CPAN shell
perl -MCPAN -e shell install App::jl
For more information on module installation, please visit the detailed CPAN module installation guide.