App-jl
view release on metacpan or search on metacpan
=encoding utf8
This is Perl module B<App::jl>.
=begin html
<a href="https://github.com/bayashi/App-jl/blob/main/lib/App/jl.pm"><img src="https://img.shields.io/badge/Version-0.20-green?style=flat"></a> <a href="https://github.com/bayashi/App-jl/blob/main/LICENSE"><img src="https://img.shields.io/badge/LICENS...
=end html
=head1 SYNOPSIS
The B<jl> command allows you to show the "JSON in JSON" log nicely. Recursively decode JSON in JSON string like below
$ 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 C<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\":1...
{
"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 in JSON logs more readable.
=head1 INSTALLATION
There are several ways to install,
1) The easiest way to install B<App::jl> is
$ curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n App::jl
2) If your L<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
( run in 2.387 seconds using v1.01-cache-2.11-cpan-0d23b851a93 )