1# Following a log: a JSON lines log grows while 012 follows it in a2# linked region (Data > Linked file > Link a table, here from the3# palette). A notebook cell (Data > Shell > Open notebook, from the4# palette too) reads it as $app and keeps the errors; running the cell5# again later (r) reads the rows the log has now. The log is6# data/requests.jsonl written a line at a time. Needs nu on the PATH.7Output out/follow-log.gif8Source lib/setup.tape9Set Theme "tokyonight"1011Hide12Type "rm -f out/app.jsonl; head -n 6 data/requests.jsonl > out/app.jsonl" Enter13Type `(tail -n +7 data/requests.jsonl | while IFS= read -r l; do sleep 0.8; printf '%s\n' "$l" >> out/app.jsonl; done) & clear; ../bin/012` Enter14Sleep 2s15Show1617Sleep 600ms18Ctrl+K19Type@100ms "link a table"20Sleep 600ms21Enter22Sleep 800ms23Type "out/app.jsonl"24Sleep 500ms25Enter26Sleep 1s27Enter28Sleep 3.5s29Screenshot out/stills/follow-log-linked.png30Ctrl+K31Type@100ms "open notebook"32Sleep 600ms33Enter34Sleep 600ms35Type "!"36Type "errors = $app | where status >= 500 | select time path status ms"37Sleep 500ms38Escape39Type "r"40Sleep 2.5s41Screenshot out/stills/follow-log-errors.png42Sleep 6s43Type "r"44Sleep 2.5s45Screenshot out/stills/follow-log-refreshed.png46Sleep 1s