出力中のログを grep するときは --line-buffered オプションを使う。
$ tail -f foo.log | grep --line-buffered error
man コマンドによる説明:
$ man grep
--line-buffered
Force output to be line buffered. By default, output is line buffered when standard output is a terminal and
block buffered otherwise.