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
# http — access-log dashboard: status codes, top paths, live tail (JSON logs).
#   tail -f access.json | arb -p http
bars .status
bars .paths
tail .log
source .status { in.json; field status; tally }
source .paths  { in.json; field path; tally }
source .log    { in }

test "status tally" { given "{\"status\":200,\"path\":\"/a\"}" "{\"status\":500,\"path\":\"/b\"}" "{\"status\":200,\"path\":\"/c\"}"; run { in.json; field status; tally }; want "200\t2" "500\t1" }
test "path tally" { given "{\"status\":200,\"path\":\"/a\"}" "{\"status\":200,\"path\":\"/b\"}" "{\"status\":200,\"path\":\"/a\"}"; run { in.json; field path; tally }; want "/a\t2" "/b\t1" }