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
12
13
14
15
16
17
18
# systemd — journal priority breakdown from journalctl JSON
#   journalctl -o json | arb -p systemd
bars .priority
source .priority { in.json; field PRIORITY; tally }

tail .messages
source .messages { in.json; field MESSAGE }

test "journal priority breakdown" {
    given "{\"PRIORITY\":\"6\",\"MESSAGE\":\"a\"}" "{\"PRIORITY\":\"3\",\"MESSAGE\":\"b\"}" "{\"PRIORITY\":\"6\",\"MESSAGE\":\"c\"}"
    run { in.json; field PRIORITY; tally }
    want "6\t2" "3\t1"
}
test "journal messages" {
    given "{\"PRIORITY\":\"6\",\"MESSAGE\":\"started\"}" "{\"PRIORITY\":\"3\",\"MESSAGE\":\"boom\"}"
    run { in.json; field MESSAGE }
    want "started" "boom"
}