| 1 | # humanlog |
| 2 | |
| 3 | Read logs from `stdin` and prints them back to `stdout`, but prettier. |
| 4 | |
| 5 | # Using it |
| 6 | |
| 7 | ## On macOS |
| 8 | |
| 9 | ```bash |
| 10 | brew tap humanlogio/homebrew-tap |
| 11 | brew install humanlog |
| 12 | ``` |
| 13 | |
| 14 | ## On linux (and macOS) |
| 15 | |
| 16 | ```bash |
| 17 | curl -L "https://humanlog.io/install.sh" | sh |
| 18 | ``` |
| 19 | |
| 20 | ## Otherwise |
| 21 | |
| 22 | [Grab a release](https://github.com/humanlogio/humanlog/releases)! |
| 23 | |
| 24 | # Example |
| 25 | |
| 26 | If you emit logs in JSON or in [`logfmt`](https://brandur.org/logfmt), you will enjoy pretty logs when those |
| 27 | entries are encountered by `humanlog`. Unrecognized lines are left unchanged. |
| 28 | |
| 29 | ``` |
| 30 | $ humanlog < /var/log/logfile.log |
| 31 | ``` |
| 32 | |
| 33 |  |
| 34 | |
| 35 | # Usage |
| 36 | |
| 37 | ``` |
| 38 | NAME: |
| 39 | humanlog - reads structured logs from stdin, makes them pretty on stdout! |
| 40 | |
| 41 | USAGE: |
| 42 | humanlog [global options] command [command options] [arguments...] |
| 43 | |
| 44 | VERSION: |
| 45 | 0.7.2+48f11b1 |
| 46 | |
| 47 | AUTHOR: |
| 48 | Antoine Grondin <[email protected]> |
| 49 | |
| 50 | COMMANDS: |
| 51 | version Interact with humanlog versions |
| 52 | help, h Shows a list of commands or help for one command |
| 53 | |
| 54 | GLOBAL OPTIONS: |
| 55 | --config value specify a config file to use, otherwise uses the default one |
| 56 | --skip value keys to skip when parsing a log entry |
| 57 | --keep value keys to keep when parsing a log entry |
| 58 | --sort-longest sort by longest key after having sorted lexicographically |
| 59 | --skip-unchanged skip keys that have the same value than the previous entry |
| 60 | --truncate truncates values that are longer than --truncate-length |
| 61 | --truncate-length value truncate values that are longer than this length (default: 15) |
| 62 | --color value specify color mode: auto, on/force, off (default: "auto") |
| 63 | --light-bg use black as the base foreground color (for terminals with light backgrounds) |
| 64 | --time-format value output time format, see https://golang.org/pkg/time/ for details (default: "Jan _2 15:04:05") |
| 65 | --ignore-interrupts, -i ignore interrupts |
| 66 | --message-fields value, -m value Custom JSON fields to search for the log message. (i.e. mssge, data.body.message) [$HUMANLOG_MESSAGE_FIELDS] |
| 67 | --time-fields value, -t value Custom JSON fields to search for the log time. (i.e. logtime, data.body.datetime) [$HUMANLOG_TIME_FIELDS] |
| 68 | --level-fields value, -l value Custom JSON fields to search for the log level. (i.e. somelevel, data.level) [$HUMANLOG_LEVEL_FIELDS] |
| 69 | --help, -h show help |
| 70 | --version, -v print the version |
| 71 | ``` |
| 72 | |
| 73 | [l2met]: https://github.com/ryandotsmith/l2met |