[Logcheck-devel] Bug#295560: logcheck: Please include filename when reporting "invalid regular expression"

Jamie L. Penman-Smithson jamie at silverdream.org
Wed Feb 16 19:41:07 UTC 2005


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 <jamie at silverdream.org> | spamtrap: spam at silverdream.org
 w: http://www.silverdream.org | p: sms at silverdream.org
 pgp key @ http://silverdream.org/~jps/pub.key
 21:30:02 up 17 min,  2 users,  load average: 2.65, 2.52, 1.58

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.alioth.debian.org/pipermail/logcheck-devel/attachments/20050216/8d68f6df/attachment.pgp 


More information about the Logcheck-devel mailing list