I've got a command that outputs a few different lines constantly (a stream), I'd like a live summary of the number of times each line has occurred (with a few seconds latency being acceptable).
for example if my command outputs the following:
I'd like something like:
and for the output to refresh every few seconds.
How might I achieve this? (rereading an entire log file will take too long, it has to be the output of a live pipe)