From: Friedrich Clausen on
Hi All,

I am trying to filter out Java stack traces from a log file and
thereby only send the initial exception so as to make the emails
smaller. In my manual tests this works (stack traces are not in
emails) but when running from cron the exceptions are not filtered out
(stack traces are present in logcheck emails). When I test manually, I
do the following -

$ cat sample.txt|sed -e 's/[space]*$//' | egrep -v -f ./gigaspaces

(I got this from http://wiki.logcheck.org/DevelTipsTricks)

This works as expected.

To summerise - the symptoms are as follows (with more details to follow)

* Logwatch from cron - Stack traces are not filtered out
* egrep manually run - Stack traces are filtered out

I have decided to use pastebin to keep this email readable so below is
the exception and stack trace

http://pastebin.com/1miZ0VJC

and here is the logcheck regex config stored in
/etc/logcheck/ignore.d.server/gigaspaces

http://pastebin.com/z9hcfKqC

Any input into this logcheck behaviour would be much appreciated.

Cheers,

Fred.


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/w2uff5ddf021004280826o574afd4ekb38237591a60cf13(a)mail.gmail.com
From: Chris Jackson on
Friedrich Clausen wrote:

> Hi All,
>
> I am trying to filter out Java stack traces from a log file and
> thereby only send the initial exception so as to make the emails
> smaller. In my manual tests this works (stack traces are not in
> emails) but when running from cron the exceptions are not filtered out
> (stack traces are present in logcheck emails). When I test manually, I
> do the following -
>
> $ cat sample.txt|sed -e 's/[space]*$//' | egrep -v -f ./gigaspaces


I suspect it's because you're using a relative path (./gigaspaces).
You'll need the full path to it from cron which may not be in the same
directory you were in.


--
Chris Jackson
Shadowcat Systems Ltd.


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/4BD854DD.1080300(a)shadowcat.co.uk
From: Friedrich Clausen on
>
> I suspect it's because you're using a relative path (./gigaspaces). You'll
> need the full path to it from cron which may not be in the same directory
> you were in.

Thanks for your reply. I am using an identical copy of the file on my
workstation and some excerpts from the logs. But I ran the egrep check
on the server itself using the actual logcheck configuration and log
file (fed it to "egrep -f") and it works as expected - stack traces
are filtered out. But when logcheck runs from cron then the stack
traces are not filtered out (using the same config file). Its bizarre
- I'll see what else I can find out.

Cheers,

Fred.
>
>
> --
> Chris Jackson
> Shadowcat Systems Ltd.
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/y2sff5ddf021004290429ta9da82dcje39f9482556a3062(a)mail.gmail.com