https://github.com/yoanm/jsontail
Tail command for json log file (Go)
https://github.com/yoanm/jsontail
go json tail
Last synced: 2 months ago
JSON representation
Tail command for json log file (Go)
- Host: GitHub
- URL: https://github.com/yoanm/jsontail
- Owner: yoanm
- License: gpl-3.0
- Created: 2018-03-01T07:39:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-12T18:40:21.000Z (over 8 years ago)
- Last Synced: 2024-10-19T09:04:48.296Z (over 1 year ago)
- Topics: go, json, tail
- Language: Go
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsonTail
tail command for json log file
## How to install
```bash
go get github.com/yoanm/jsonTail
```
`jsonTail` command will be available under ` $GOPATH/bin`
## Options
Following command will output available options
```bash
jsonTail --help
```
* `-date` : will print line handling date in front of each processed lines
### File
* `-f FILE_PATH` : will open `FILE_PATH` and wait for update. *Behaves like `tail -f` command*
* `-F FILE_PATH` : Same behavior than `-f` but file will be reopened if recreated. *Behaves like `tail -F` command*
### Fields matching/exclusion
**Fields matching or exclusion only work with objects**
* `-only FIELD` : will output only specified field. Multiple fields could be specified by using multiple `-only`.
Field matching is made thanks to `github.com/tidwall/gjson` package.
See [`github.com/tidwall/gjson` path syntac](https://github.com/tidwall/gjson#path-syntax) for more information about paths
* `-exclude FIELD` : will exclude specified field from output. Multiple fields could be specified by using multiple `-exclude`.
Field matching is made thanks to `github.com/tidwall/sjson` package.
See [`github.com/tidwall/sjson` path syntac](https://github.com/tidwall/sjson#path-syntax) for more information about paths
## Dependencies
Following external packages are used under the hood :
* [github.com/hpcloud/tail](https://github.com/hpcloud/tail)
* [github.com/tidwall/sjson](https://github.com/tidwall/sjson)
* [github.com/tidwall/gjson](https://github.com/tidwall/gjson)
* [github.com/hokaccha/go-prettyjson](https://github.com/hokaccha/go-prettyjson)
* [github.com/fatih/color](https://github.com/fatih/color)