|
| 1 | +# JSON Log Viewer |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +[](https://goreportcard.com/report/github.com/hedhyw/json-log-viewer) |
| 6 | +[](https://coveralls.io/github/hedhyw/json-log-viewer?branch=main) |
| 7 | + |
| 8 | +It is an interactive tool for viewing and analyzing complex log files with structured JSON logs. |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +Main features: |
| 13 | +1. It is interactive. |
| 14 | +2. Is shows similified log records. |
| 15 | +3. It is possible to see the full prettified JSON after clicking. |
| 16 | +4. It includes non-JSON logs as they are. |
| 17 | +5. It understands different field names. |
| 18 | +6. It supports case-insensitive filtering. |
| 19 | +7. It is simple. |
| 20 | + |
| 21 | +It uses [antonmedv/fx](https://github.com/antonmedv/fx) for viewing JSON and [charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) for terminal UI. The tool is inspired by the project [json-log-viewer](https://github.com/gistia/json-log-viewer) which is unfortunately outdated. |
| 22 | + |
| 23 | +## Table of content |
| 24 | + |
| 25 | +- [JSON Log Viewer](#json-log-viewer) |
| 26 | + - [Table of content](#table-of-content) |
| 27 | + - [Usage](#usage) |
| 28 | + - [Install](#install) |
| 29 | + - [MacOS/Linux HomeBrew](#macoslinux-homebrew) |
| 30 | + - [Go](#go) |
| 31 | + - [Package](#package) |
| 32 | + - [Standalone Binary](#standalone-binary) |
| 33 | + - [Source](#source) |
| 34 | + - [Roadmap](#roadmap) |
| 35 | + - [Resources](#resources) |
| 36 | + - [License](#license) |
| 37 | + |
| 38 | + |
| 39 | +## Usage |
| 40 | + |
| 41 | +```sh |
| 42 | +jlv file.json |
| 43 | +``` |
| 44 | + |
| 45 | +| Key | Action | |
| 46 | +| ------ | -------------- | |
| 47 | +| Enter | Open/Close log | |
| 48 | +| F | Filter | |
| 49 | +| Ctrl+C | Exit | |
| 50 | +| Esc | Back | |
| 51 | +| ↑↓ | Navigation | |
| 52 | + |
| 53 | +## Install |
| 54 | + |
| 55 | +### MacOS/Linux HomeBrew |
| 56 | + |
| 57 | +```sh |
| 58 | +brew install hedhyw/main/json-log-viewer |
| 59 | +``` |
| 60 | + |
| 61 | +### Go |
| 62 | + |
| 63 | +```bash |
| 64 | +go install github.com/hedhyw/json-log-viewer/cmd/jlv@latest |
| 65 | +``` |
| 66 | + |
| 67 | +### Package |
| 68 | + |
| 69 | +Latest DEB and RPM packages are available on [the releases page](https://github.com/hedhyw/json-log-viewer/releases/latest). |
| 70 | + |
| 71 | +### Standalone Binary |
| 72 | + |
| 73 | +Download latest archive `*.tar.gz` for your target platform from [the releases page](https://github.com/hedhyw/json-log-viewer/releases/latest) and extract it to `/usr/local/bin/jlv`. Add this path to `PATH` environment. |
| 74 | + |
| 75 | +### Source |
| 76 | + |
| 77 | +``` |
| 78 | +git clone [email protected]:hedhyw/json-log-viewer.git |
| 79 | +cd json-log-viewer |
| 80 | +make build |
| 81 | +cp ./bin/jlv /usr/local/bin |
| 82 | +chmod +x /usr/local/bin/jlv |
| 83 | +``` |
| 84 | + |
| 85 | +## Roadmap |
| 86 | + |
| 87 | +- Accept stream of logs. |
| 88 | +- Add colors to log levels. |
| 89 | +- Add a configuration file (similar to `.json-log-viewer`). |
| 90 | +- Convert number timestamps. |
| 91 | + |
| 92 | +## Resources |
| 93 | + |
| 94 | +Alternatives: |
| 95 | +- [mightyguava/jl](https://github.com/mightyguava/jl) - Pretty Viewer for JSON logs. |
| 96 | +- [pamburus/hl](https://github.com/pamburus/hl) - A log viewer that translates JSON logs into human-readable representation. |
| 97 | +- [json-log-viewer](https://github.com/gistia/json-log-viewer) - Powerful terminal based viewer for JSON logs using ncurses. |
| 98 | + |
| 99 | +## License |
| 100 | + |
| 101 | +[MIT License](LICENSE). |
0 commit comments