views:

550

answers:

8

Is anyone aware of any linux utility that can monitor logs in realtime and trigger events based on specific log content? Thanks.

+1  A: 

There's a package called sec or Simple Events Coordinator that I use to detect when an unregistered computer gets a DHCPACK.

Tom Ritter
+1  A: 

tail -f "path to log file"

Can monitor your logs in real-time, but it won't raise any events.

What do you mean by event triggering? Do you want to run certain commands when a log message appears with a certain content?

Ben S
e.g. send an email when the log prints out "System ready to blow up, please stand by"
Steve B.
You can route different log levels to different files in syslog and for instance when you get a critical error "tail -f /var/log/critical | mail <stuff here>" grabs it and sends an email.
frgtn
@Steve B. Shouldn't that be "System ready to blow up, RUN AWAY!" ?
Chris Huang-Leaver
+3  A: 

Log Surfer

From: http://www.crypt.gen.nz/logsurfer/#download

Logsurfer is a program for monitoring system logs in real-time, and reporting on the occurrence of events. It is similar to the well-known swatch program on which it is based, but offers a number of advanced features which swatch does not support.

Elijah
+1  A: 

you could pipe your logfile through awk and call any desired action on specified patterns.

Jens Schauder
+1  A: 

Check out the logwatch and logcheck packages for Ubunutu. They generally run at a specified interval, (configurable) but may be able to do what you'd like.

slacy
+1  A: 

http://www.splunk.com/

garym
A: 
Fernando
A: 

log2mail, available under Debian

Xavier Montagutelli