神刀安全网

Logs for humans to read

humanlog

Read logs from stdin and prints them back to stdout , but prettier.

Using it

Grab a release or :

With Go installed

$ go get -u github.com/aybabtme/humanlog/...

On linux

wget -qO- https://github.com/aybabtme/humanlog/releases/download/0.1.7/humanlog_linux_amd64.tar.gz | tar xvz

On OS X

wget -qO- https://github.com/aybabtme/humanlog/releases/download/0.1.7/humanlog_darwin_amd64.tar.gz | tar xvz

Example

If you emit logs in JSON or in logfmt , you will enjoy pretty logs when those entries are encountered by humanlog . Unrecognized lines are left unchanged.

$ humanlog < /var/log/logfile.log 

Logs for humans to read

Contributing

How to help:

  • support more log formats : by submitting human.Handler implementations.
  • live querying : add support for filtering in log output in real time.
  • charting : some key-values have semantics that could be charted in real time. For instance, durations, frequency of numeric values, etc. See thel2met project.

Usage

NAME:    humanlog - reads structured logs from stdin, makes them pretty on stdout!  USAGE:    humanlog [global options] command [command options] [arguments...]  VERSION:    0.1.7  AUTHOR:   Antoine Grondin - <antoine@digitalocean.com>  COMMANDS:    help, h  Shows a list of commands or help for one command  GLOBAL OPTIONS:    --skip '--skip option --skip option'   keys to skip when parsing a log entry    --keep '--keep option --keep option'   keys to keep when parsing a log entry    --sort-longest       sort by longest key after having sorted lexicographically    --skip-unchanged        skip keys that have the same value than the previous entry    --truncate           truncates values that are longer than --truncate-length    --truncate-length '15'     truncate values that are longer than this length    --help, -h           show help    --version, -v        print the version 

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Logs for humans to read

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址