#json-log #log #json #cli #log-format #k8s #stern

app json-log-parse

Log tailer for deployments using JSON log format

4 releases (2 breaking)

0.3.0 Mar 8, 2022
0.2.0 Mar 3, 2022
0.1.2 Mar 3, 2022
0.1.1 Mar 3, 2022
0.1.0 Mar 3, 2022

#26 in #json-log

Apache-2.0

11KB
189 lines

json-log-parse

CLI tool for tailing logs from deployments using JSON log format.

Installing

This is implemented in Rust and published as binary crate on crates.io

First, install rust if you don't already have it:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Then, install the tool:

cargo install json-log-parse

You will also need stern installed:

brew install stern

Usage

Example, using service-mortgage and leveraging stern for a standalone command:

json-log-parse stern -a service-mortgage -s 5m

Example, using stdin:

echo -n '{"timestamp": "1", "logger.thread_name": "thread1", "logger.name": "name1", "level": "INFO", "message": "log message 1"}' | json-log-parse stdin

To get help:

json-log-parse --help

Dependencies

~6–21MB
~246K SLoC