[lug] sending log files to another machine

Walter Pienciak walter at frii.com
Mon Jan 10 14:59:20 MST 2000


On Mon, 10 Jan 2000, Walter Pienciak wrote:
> On Mon, 10 Jan 2000, Michael Deck wrote:
> 
> > Something I do (for other purposes) is
> > 
> > cat log_file | mail user at machine
> > 
> 
> Yep, I do this too.  I also stuff a few egrep -v commands in the
> middle of that pipe to filter out the uninteresting stuff and
> send myself abridged versions that I actually look at.  Adding
> subject-line info to the message (man your_mail_program) helps.
> 
> Walter

Uhhh, maybe this wasn't so clear.  Like this Bourne shell snippet from
a weblogs program:

report_daily_abridged="me at foo.com you at bar.com"

for name in `echo $report_daily_abridged`
    do
        egrep -v "send body lost connection" \
            ${archivedir}/${yy}-${ym}/${yd}.${hostname}.error_log |
        egrep -v "SSize" |
        egrep -v "send body timed out" |
        egrep -v "lingering close lost connection" |
        egrep -v "read request line timed out" |
        /bin/mailx -s "$hostname ABRIDGED web errors: $yd $ym" $name
    done



# Walter  ;^)







More information about the LUG mailing list