Skip to content

Commit

Permalink
docs: update the README demo
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKing committed Feb 25, 2023
1 parent de8bf9e commit a6bf98f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 deletions.
Binary file modified .github/assets/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions .github/assets/demo.tape
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,22 @@ Set Height 800

Hide
Type `cd ~/Developer/packages/tail-jsonl` Enter Sleep 500ms
Type `echo '{"elapsed": {"repr": "0:00:00.340931", "seconds": 0.340931}, "exception": null, "extra": {"data": {"key1": 123}}, "file": {"name": "script.py", "path": "/~/Developer/packages/tail-jsonl/script.py"}, "function": "<module>", "level": "DEBUG", "level-icon": "🐞", "level-no": 10, "line": 31, "message": "debug-level log", "module": "dodo", "name": "dodo", "process": {"id": 16268, "name": "MainProcess"}, "thread": {"id": 8821244160, "name": "MainThread"}, "timestamp": "2023-01-31 06:16:00.910671-05:00"}' > .logs/debug-example.jsonl` Enter Sleep 500ms
Type `echo 'eyJ0ZXh0IjogIjIwMjMtMDEtMzEgMDY6MTY6MDAuOTExIHwgRVJST1IgICAgfCBkb2RvOjxtb2R1bGU+OjM4IC0gZXhjZXB0aW9uLWxldmVsIGxvZ1xuVHJhY2ViYWNrIChtb3N0IHJlY2VudCBjYWxsIGxhc3QpOlxuXG4gIEZpbGUgXCIvVXNlcnMva3lsZWtpbmcvRGV2ZWxvcGVyL3BhY2thZ2VzL3RhaWwtanNvbmwvLnZlbnYvYmluL2RvaXRcIiwgbGluZSA4LCBpbiA8bW9kdWxlPlxuICAgIHN5cy5leGl0KG1haW4oKSlcbiAgICDilIIgICDilIIgICAg4pSUIDxmdW5jdGlvbiBtYWluIGF0IDB4MTAzYzNhMmEwPlxuICAgIOKUgiAgIOKUlCA8YnVpbHQtaW4gZnVuY3Rpb24gZXhpdD5cbiAg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ICI8bW9kdWxlPiIsICJsZXZlbCI6IHsiaWNvbiI6ICLinYwiLCAibmFtZSI6ICJFUlJPUiIsICJubyI6IDQwfSwgImxpbmUiOiAzOCwgIm1lc3NhZ2UiOiAiZXhjZXB0aW9uLWxldmVsIGxvZyIsICJtb2R1bGUiOiAiZG9kbyIsICJuYW1lIjogImRvZG8iLCAicHJvY2VzcyI6IHsiaWQiOiAxNjI2OCwgIm5hbWUiOiAiTWFpblByb2Nlc3MifSwgInRocmVhZCI6IHsiaWQiOiA4ODIxMjQ0MTYwLCAibmFtZSI6ICJNYWluVGhyZWFkIn0sICJ0aW1lIjogeyJyZXByIjogIjIwMjMtMDEtMzEgMDY6MTY6MDAuOTExNDk5LTA1OjAwIiwgInRpbWVzdGFtcCI6IDE2NzUxNjAxNjAuOTExNDk5fX19' | base64 --decode > .logs/exception-example.jsonl` Enter Sleep 500ms
Type `echo '{"elapsed": {"repr": "0:00:00.340931", "seconds": 0.340931}, "exception": null, "extra": {"data": {"key1": 123}}, "file": {"name": "script.py", "path": "/~/Developer/packages/tail-jsonl/script.py"}, "function": "<module>", "level": "DEBUG", "level-icon": "🐞", "level-no": 10, "line": 31, "message": "debug-level log", "module": "dodo", "name": "dodo", "process": {"id": 16268, "name": "MainProcess"}, "thread": {"id": 8821244160, "name": "MainThread"}, "timestamp": "2023-01-31 06:16:00.910671-05:00"}' > debug-example.jsonl` Enter Sleep 500ms
Type `echo 'eyJyZWNvcmQiOiB7ImVsYXBzZWQiOiB7InJlcHIiOiAiMDowMDowMC4zNDE3NTkiLCJzZWNvbmRzIjogMC4zNDE3NTl9LCJleGNlcHRpb24iOiB7InRyYWNlYmFjayI6IHRydWUsInR5cGUiOiAiWmVyb0RpdmlzaW9uRXJyb3IiLCJ2YWx1ZSI6ICJpbnRlZ2VyIGRpdmlzaW9uIG9yIG1vZHVsbyBieSB6ZXJvIn0sImV4dHJhIjoge30sImZpbGUiOiB7Im5hbWUiOiAiZG9kby5weSIsInBhdGgiOiAiL1V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90YWlsLWpzb25sL2RvZG8ucHlcIiwgbGluZSAzNiwgaW4gPG1vZHVsZT5cbiAgICAxIC8vIDBcbiAgICBcbiAgICBaZXJvRGl2aXNpb25FcnJvcjogaW50ZWdlciBkaXZpc2lvbiBvciBtb2R1bG8gYnkgemVyb1xuIn0=' | base64 --decode > exception-example.jsonl` Enter Sleep 500ms
Type `clear` Enter
Show

Type `cat .logs/debug-example.jsonl` Sleep 500ms Enter Sleep 1s
Type `cat debug-example.jsonl` Sleep 500ms Enter Sleep 1s
Type `` Enter
Type `cat debug-example.jsonl | poetry run tail-jsonl` Sleep 500ms Enter Sleep 3s
Type `` Enter
Type `cat debug-example.jsonl | poetry run tail-jsonl --config-path .github/assets/demo_config.toml` Sleep 500ms Enter Sleep 3s
Type `` Enter
Type `cat .logs/debug-example.jsonl | tail-jsonl` Sleep 500ms Enter Sleep 3s
Type `` Enter

Type `cat .logs/exception-example.jsonl` Sleep 500ms Enter Sleep 1s
Type `cat exception-example.jsonl` Sleep 500ms Enter Sleep 1s
Type `` Enter
Type `cat .logs/exception-example.jsonl | poetry run tail-jsonl` Sleep 500ms Enter Sleep 3s
Type `` Enter
Type `cat exception-example.jsonl | poetry run tail-jsonl` Sleep 500ms Enter Sleep 3s

Type `rm debug-example.jsonl && rm exception-example.jsonl` Sleep 1ms Enter
14 changes: 14 additions & 0 deletions .github/assets/demo_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[keys]
on_own_line = ["exception", "extra", "file", "process", "text", "thread"]

[styles]
key = "#449baa"
level_debug = "#7FBCF5"
level_error = "#F08B8D"
level_fallback = ""
level_info = "#bbf57d"
level_warn = "#F6A788"
message = "bold #aeb6dc"
timestamp = "#7c819d"
value = "#ac8de4"
value_own_line = "italic"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# tail-jsonl

![.github/assets/demo.gif](https://raw.githubusercontent.com/KyleKing/tail-jsonl/main/.github/assets/demo.gif)

Pretty Print Tailed JSONL Logs

Documentation can be found on [Github (./docs)](./docs), [PyPi](https://pypi.org/project/tail_jsonl/), or [Hosted](https://tail-jsonl.kyleking.me/)!
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ I wanted to find a tool that could:

I investigated a lot of alternatives such as: [humanlog](https://github.com/humanlogio/humanlog), [lnav](https://docs.lnav.org/en/latest/formats.html#), [goaccess](https://goaccess.io/get-started), [angle-grinder](https://github.com/rcoh/angle-grinder#rendering), [jq](https://github.com/stedolan/jq), [textualog](https://github.com/rhuygen/textualog), etc. but nothing would both cleanly format the JSONL data and show the exception.

![.github/assets/demo.gif](https://raw.githubusercontent.com/KyleKing/tail-jsonl/main/.github/assets/demo.gif)

## Installation

[Install with `pipx`](https://pypi.org/project/pipx/)
Expand All @@ -28,7 +30,7 @@ Pipe JSONL output from any file, kubernetes (such as [stern](https://github.com/
echo '{"message": "message", "timestamp": "2023-01-01T01:01:01.0123456Z", "level": "debug", "data": true, "more-data": [null, true, -123.123]}' | tail-jsonl
cat tests/data/logs.jsonl | tail-jsonl

# Optionall, pre-filter or format with jq, grep, awk, or other tools
# Optionally, pre-filter or format with jq, grep, awk, or other tools
cat tests/data/logs.jsonl | jq '.record' --compact-output | tail-jsonl

# An example stern command (also consider -o=extjson)
Expand All @@ -38,8 +40,6 @@ stern envvars --context staging --container gateway --since="60m" --output raw |
docker compose logs --follow | awk 'match($0, / \| \{.+/) { print substr($0, RSTART+3, RLENGTH); system("") }' | tail-jsonl
```

![.github/assets/demo.gif](https://raw.githubusercontent.com/KyleKing/tail-jsonl/main/.github/assets/demo.gif)

## Configuration

Optionally, specify a path to a custom configuration file. See an example configuration file at: [tests/config_default.toml](https://github.com/KyleKing/tail-jsonl/blob/main/tests/config_default.toml)
Expand Down

0 comments on commit a6bf98f

Please sign in to comment.