Bug#295560: logcheck: Please include filename when reporting invalid regular expression

2005-02-17 Thread Frank Küster
Jamie L. Penman-Smithson [EMAIL PROTECTED] wrote:

 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?

No, not really. I know I can find the problematic file this way. But I
would prefer to get an indication about this in the mail that cron
sends. If an inexperienced user gets a mail with a subject from some
crontab file and a body that only says grep: invalid regular
expression, he will problably not know at once what this means (and I
must say that I was not sure that it was an error in one of my logcheck
filter files until I saw the debug output).

What I suggest is that for each egrep over the filter files, you check
whether the return value is 2, and if yes send a message to stderr:

logcheck found an invalid regular expression in file $file 

(ideally with the temporary directory mapped back to the original
location).

Regards, Frank

-- 
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer




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

2005-02-17 Thread Todd Troxell
On Thu, Feb 17, 2005 at 10:15:24AM +0100, Frank Küster wrote:
 What I suggest is that for each egrep over the filter files, you check
 whether the return value is 2, and if yes send a message to stderr:
 
 logcheck found an invalid regular expression in file $file 
 
 (ideally with the temporary directory mapped back to the original
 location).

Cool. I like this idea.  Expect to see it soon.


-- 
[   Todd J. Troxell ,''`.
  Student, Debian GNU/Linux Developer, SysAdmin, Geek  : :' :
  http://debian.org || http://rapidpacket.com/~xtat`. `' 
 `- ]