Giter Site home page Giter Site logo

json-log-viewer's Introduction

json-log-viewer

npm version

Powerful terminal based viewer for JSON logs using ncurses.

screenshot

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 and page up/down to move
  • / to search
  • n to search again
  • s to sort
  • f to filter
  • l to filter by level
  • g to go to line
  • 0 to go to first line
  • $ to go to last line
  • q 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:

{
  "message":
    "Matched route \"**_heartbeat_check\" (parameters: \"_controller\": \"**\\Controller\\**Controller::heartbeatCheckAction\", \"_route\": \"**_heartbeat_check\")",
  "context": [],
  "level": 200,
  "level_name": "INFO",
  "channel": "request",
  "datetime": {
    "date": "2017-12-06 09:23:42.253060",
    "timezone_type": 3,
    "timezone": "Europe/Berlin"
  },
  "extra": []
}

You can create a mapping configuration like this:

[transform]
level=level_name
timestamp=datetime.date
message=message
extra=$

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:

transform

Screenshots

Details view

screenshot

Filters

screenshot

Log level selection

screenshot

License

MIT

json-log-viewer's People

Contributors

fcoury avatar techieshark avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.