On Wed, 2005-02-16 at 18:49 +0100, Frank Küster wrote: > I have a couple of home-made logcheck ignore files, and happened to > have one unescaped (and unmatched) `(' in one of the filter > lines. Because of this, cron sent a mail with the body "grep: Invalid > regular expression" - the subject is the command in the "2 * * * *" > line in /etc/cron.d/logcheck, of course. > > It would be nice if logcheck would tell me in which file the error > was. This should be easy, since egrep returns 1 if it finds no match > and 2 with an invalid regular expression.
If you run logcheck in debug mode you'll be able to find out which file the error is in. For example, I added this to ignore.d.server/logcheck: ^\w{3} [ :0-9]{11} [._[:alnum:]-]+ foobar\[[0-9]+\]: test (foo test$ Running logcheck -otd gives: [...] D: [1108580515] cleanchecked - dir - /tmp/logcheck.pFqP43/ignore/logcheck grep: Invalid regular expression [...] I think this is what you're looking for? -- -jamie <[EMAIL PROTECTED]> | spamtrap: [EMAIL PROTECTED] w: http://www.silverdream.org | p: [EMAIL PROTECTED] pgp key @ http://silverdream.org/~jps/pub.key 21:30:02 up 17 min, 2 users, load average: 2.65, 2.52, 1.58
signature.asc
Description: This is a digitally signed message part