I am looking for a tool which does something similar to
tail -f /var/log/some.log | grep EVENT1 |rate
which keeps displaying the rate of the event.
tail -f /var/log/some.log | grep --line-buffered EVENT1 | pv -l > /dev/null
pv is a pipe monitor, which outputs statistics on stderr; the -l will measure lines instead of bytes.
You'll need to use --line-buffered on your grep call, so that it doesn't buffer larger blocks, or for a general case you can use stdbuf to adjust your buffering.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With