How to watch for count of new lines in tail

Posted by fl00r on Server Fault See other posts from Server Fault or by fl00r
Published on 2012-10-22T12:27:10Z Indexed on 2013/11/06 9:57 UTC
Read the original article Hit count: 233

Filed under:
|
|

I want to do something like this:

watch tail -f | wc -l
#=> 43
#=> 56
#=> 61
#=> 44
#=> ...

It counts new lines of tail each second

/ Linux, CentOs

To be more clear. I have got something like this:

tail -f /var/log/my_process/*.log | grep error

I am reading some error messages. And now I want to count them. How many ~ errors I have got in a second. So one line in a log is one error in a proccess.

© Server Fault or respective owner

Related posts about tail

Related posts about watch