tail command for json log file
go get github.com/yoanm/jsonTailjsonTail command will be available under $GOPATH/bin
Following command will output available options
jsonTail --help-date: will print line handling date in front of each processed lines
-f FILE_PATH: will openFILE_PATHand wait for update. Behaves liketail -fcommand-F FILE_PATH: Same behavior than-fbut file will be reopened if recreated. Behaves liketail -Fcommand
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/gjsonpackage.See
github.com/tidwall/gjsonpath syntac 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/sjsonpackage.See
github.com/tidwall/sjsonpath syntac for more information about paths
Following external packages are used under the hood :