Monitor Console.app for a string and notify when found

consolehard drivescript

Is it possible to monitor all messages in Console.app for a string and then notify the user when this string occurs?

I have the problem that I'm getting disk I/O errors and I suspect that it's not a HDD failure, but somehow is caused by a piece of software. The only way I know that I have disk I/O errors is that I sometimes look through all the messages in the Console.app out of curiosity. Of course this does not give me real time information.
Therefore I want to receive a notification when the following message occurs in the Console:

07/01/2013 20:59:06 kernel  disk0s1: I/O error.

Is this somehow possible? It's OK if this means that Console has to be on all the time.

I'm on Snow Leopard 10.6.8.

Best Answer

I would not use Console.app. Instead use Terminal.app with the following command:

tail -f /var/log/system.log | grep "string you are looking for"

then leave that window open and you will see all matching entries in that window as you work.

Also know that when the system.log file is rotated (due to size/time) tail will stop. you will need to restart the command.