json-log-viewer
Powerful terminal based viewer for JSON logs using ncurses.
json-log-viewer is a feature intensive viewer and analyze tool for JSON logs created by libraries like https://github.com/winstonjs/winston.
Features:
- completely operated by hotkeys
- powerful command line arguments
- sort by timestamp, level or message
- filter by any field or metadata
- search
Hotkeys:
arrows
andpage up/down
to move/
to searchn
to search agains
to sortf
to filterl
to filter by levelg
to go to line0
to go to first line$
to go to last lineq
to quit
Install
npm install --global json-log-viewer
Usage
jv application.log.2017-01-01 --sort -timestamp
Configuration
The default expected log format include fields timestamp
, level
and message
. If the log file you're trying to parse doesn't include those fields, you can create a config file on your HOME path called .json-log-viewer
.
For example, if your log lines look like this:
You can create a mapping configuration like this:
[transform]level=level_nametimestamp=datetime.datemessage=messageextra=$
This way the messages will properly be displayed. The $
has a special meaning: it tells the the old object should be included on the extra
key on the resulting JSON. The result will look like this:
Screenshots
Details view
Filters
Log level selection