in reply to Best method to monitor active syslog files?
I find the easiest way to do it is with Parse::Syslog and File::Tail...
#!/usr/bin/perl -w use strict; use warnings; use File::Tail; use Parse::Syslog; my $log = File::Tail->new("/var/log/syslog"); my $parser = Parse::Syslog->new($log); while(my $sl = $parser->next) { print qq[ program $sl->{program} with pid $sl->{pid} on host $sl->{host} said $sl->{text} at $sl->{timestamp} ]; }
| We're not surrounded, we're in a target-rich environment! |
|---|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Best method to monitor active syslog files?
by neilwatson (Priest) on Feb 08, 2006 at 20:36 UTC | |
by bowei_99 (Friar) on Feb 08, 2006 at 21:16 UTC |