我在Ubuntu 9.10机器上设置了logcheck。 在/etc/logcheck/ignore.d.server/local-rules我有一行:
^\[\w{3} \w{3} \d{1,2} \d{1,2}:\d{1,2}:\d{1,2} \d{4}\] \[error\] .*File does not exist: .*$
但我仍然不断地发送这样的电子邮件:
This email is sent by logcheck. If you no longer wish to receive such mails, you can either deinstall the logcheck package or modify its configuration file (/etc/logcheck/logcheck.conf). System Events =-=-=-=-=-=-= [Mon Sep 12 07:19:57 2011] [error] [client 66.249.67.119] File does not exist: /var/sismo/build/cdc232/test/report/coverage/typhoon_assertion_parameterlist.php.html
为什么要做比你更多的工作? :)这听起来像你想要的数据是File does not exist ,这是一个有效的正则expression式本身。
你可以进一步扩展 – 即包括[error] – 但最后,你真的关心匹配其余的线? 希望这可以帮助!