Unix Technical Forum

Real time log analysis and action

This is a discussion on Real time log analysis and action within the comp.unix.bsd.openbsd.misc forums, part of the OpenBSD category; --> Is there a program that can constantly monitor a log file (i.e. /var/log/messages) and take action in real time ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > comp.unix.bsd.openbsd.misc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-16-2008, 06:24 AM
Johnny Kim
 
Posts: n/a
Default Real time log analysis and action

Is there a program that can constantly monitor a log file (i.e.
/var/log/messages) and take action in real time when a certain action is
logged?

I know I can run a script that runs every minute as a cron job but I want
something even more responsive than that, like on the order of 3-5
seconds.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-16-2008, 06:24 AM
=?ISO-8859-1?Q?Dorian_B=FCttner?=
 
Posts: n/a
Default Re: Real time log analysis and action

Johnny Kim schrieb:
> Is there a program that can constantly monitor a log file (i.e.
> /var/log/messages) and take action in real time when a certain action is
> logged?
>
> I know I can run a script that runs every minute as a cron job but I want
> something even more responsive than that, like on the order of 3-5
> seconds.

You can convince syslog to pipe selected messages to a command.
syslog.conf
Regards,
Dorian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-16-2008, 06:24 AM
Bas Keur
 
Posts: n/a
Default Re: Real time log analysis and action

>> I know I can run a script that runs every minute as a cron job but I want
>> something even more responsive than that, like on the order of 3-5
>> seconds.

> You can convince syslog to pipe selected messages to a command.
> syslog.conf
> Regards,
> Dorian


Note when piping to `mail`

IF for some reason your ISP calls you screaming MAIL BOMB DOS !!
you might have a fast connection on the server and decided 24 hours earlier
you would like to .forward syslog messages by mail to your private/home ISP.

Changes are your file system is full heheh


] Bas Keur
] `Energizer Bunny arrested, charged with battery`


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-16-2008, 06:26 AM
Sharif Torpis
 
Posts: n/a
Default Re: Real time log analysis and action

In article <pan.2005.02.02.12.41.55.533921@sneakemail.com>,
Johnny Kim <bhhie8u02@sneakemail.com> wrote:
>Is there a program that can constantly monitor a log file (i.e.
>/var/log/messages) and take action in real time when a certain action is
>logged?
>
>I know I can run a script that runs every minute as a cron job but I want
>something even more responsive than that, like on the order of 3-5
>seconds.


http://swatch.sourceforge.net/

--
Plus ca change, plus c'est la meme chose.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-16-2008, 06:26 AM
Marko Vihoma
 
Posts: n/a
Default Re: Real time log analysis and action

Johnny Kim wrote:

> Is there a program that can constantly monitor a log file (i.e.
> /var/log/messages) and take action in real time when a certain action
> is logged?
>
> I know I can run a script that runs every minute as a cron job but I
> want something even more responsive than that, like on the order of
> 3-5 seconds.


I don't really know anything about scripting or programming, but most
languages seem to have a sleep function, and there is /bin/sleep too.
--
marko [dot] vihoma [at] dnainternet [dot] net

Keskustelua zombeista c.u.b.freebsd.misc:
Thanks, parents were stuck and had to be killed.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:01 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com