A new utility
pw (PipeWatch) has a feature for exactly this.
tail -f log.txt | pw
pw pumps data through an internal FIFO buffer, from which snapshots are taken, displayed, and pushed into a 20-screen-deep snapshot history, which can easily be visited using the up/down arrow keys or CtrlP and CtrlN.
By default, snapshots are taken every 10 seconds, or whenever there is a 1 second read timeout, and of course these timeouts can be adjusted.
The trigger feature causes the unchanging parts of repeating patterns to freeze on the screen. You can see this in the demo video.
However, you can easily put
pw into trigger mode, using commands similar to Vi searching:
?pattern. In trigger mode, the display updates whenever a match occurs against one or more lines in the FIFO. There is a lot more to it.
You can specify triggers before you start the program like this.
# trigger: match foo on line 1, bar on line 3
pw -e /foo -e 3/bar
If you have your triggers and other settings set up the way you like them, you can save the session with
:s filename, and recall with
pw -f filename; the session has your filters and triggers, plus display settings like the configuration of vertical splits. The file just contains
: (colon) commands, which you can easily edit to adjust.