arblang 0.1.24

Visualize and modify Unix pipelines: pipe a stream in, arb spawns a dynamic TUI
Documentation
1
2
3
4
5
6
7
8
9
10
11
# gitlabrunner — CI job dashboard from gitlab-runner JSON structured logs
#   gitlab-runner run --log-format json | arb -p gitlabrunner
bars .levels
source .levels { in.json; field level; tally }
gauge .received -max 100
source .received { in.json; field msg; contains received; count }
tail .jobs
source .jobs { in.json; field msg }

test "levels tally groups by log level" { given "{\"level\":\"info\",\"msg\":\"received job 1\"}" "{\"level\":\"warning\",\"msg\":\"retry\"}" "{\"level\":\"info\",\"msg\":\"done\"}"; run { in.json; field level; tally }; want "info\t2" "warning\t1" }
test "received counts received-job messages" { given "{\"level\":\"info\",\"msg\":\"received job 1\"}" "{\"level\":\"info\",\"msg\":\"received job 2\"}" "{\"level\":\"info\",\"msg\":\"done\"}"; run { in.json; field msg; contains received; count }; want "2" }