[ale] SHELL: log files monitoring

Ken Nagorski kenn at pcintelligent.com
Fri Feb 15 09:39:08 EST 2002


Hmm, I have been on a PERL kick as of late

#!/usr/bin/perl

$logfile="/var/log/auth.log";
$exp="something";

open(LOGFILE,"tail -f $logfile|") || die "Could not open $logfile $!\n";
while(<LOGFILE>)
{
     if(/$exp/)
     {
         print("Found $exp\n");
     }
}

Thanks
Ken






> Greg, Joe,
> I'll probably stay with the shell + grep. But both of the programs are
> very nice.
> Thank You
>
>
>> -----Original Message-----
>> From: Greg [mailto:runman at telocity.com]
>> Sent: Thursday, February 14, 2002 5:47 PM
>> To: Joe Steele; 'Zyman, Andy'
>> Cc: ale at ale.org
>> Subject: RE: [ale] SHELL: log files monitoring
>>
>>
>> How about swatch ? What to look for and what swatch should do
>> when it finds
>> it is configurable.
>>
>> Greg Canter
>>
>> > -----Original Message-----
>> > From: Joe Steele [mailto:joe at madewell.com]
>> > Sent: Thursday, February 14, 2002 3:29 PM
>> > To: 'Zyman, Andy'
>> > Cc: 'ale at ale.org'
>> > Subject: RE: [ale] SHELL: log files monitoring
>> >
>> >
>> > On Thursday, February 14, 2002 11:46 AM, Zyman, Andy wrote:
>> > > I have simple task : I need to monitor a log files for
>> > particular string.
>> >
>> > You might take a look at 'logcheck' (find it at freshmeat.net).  You
>> > set it up with patterns to watch for in your logs, and it sends
>> > e-mail if it finds them.  You can also set it up with patterns to
>> > ignore.  It's usually run periodically as a cron job.  It's partly a
>> > shell script, but it also includes a little program which
>> reads and tags
>> > the logfiles so that previously reviewed log entries are skipped
>> > over.
>> >
>> > --Joe
>> >
>> >
>> > ---
>> > This message has been sent through the ALE general discussion list.
>> > See http://www.ale.org/mailing-lists.shtml for more info.
>> > Problems should be
>> > sent to listmaster at ale dot org.
>> >
>> >
>> >
>>
>>
>> ---
>> This message has been sent through the ALE general discussion list.
>> See http://www.ale.org/mailing-lists.shtml for more info.
>> Problems should be
>> sent to listmaster at ale dot org.
>>




---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list