Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: guidance with a realtime log reader

by thewebsi (Scribe)
on Aug 29, 2013 at 19:32 UTC ( #1051505=note: print w/replies, xml ) Need Help??


in reply to guidance with a realtime log reader

Since Perl integrates well with the shell, you can also transition stepwise into a full Perl implementation.

For example, start with a command-line script:

>tail -f /var/log/ldap.log | perl -ne 'if ( /connection_input: conn=11/ ) { system ( "send an email" ); system ( "restart ldap" ); }'

Then move the code into a Perl script file:

>tail -f /var/log/ldap.log | process.pl

Then take over the function of tail in Perl:

>process.pl

And finally maybe replace some of the system calls with Perl equivalents (eg, Mail::Sendmail)...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1051505]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2022-08-09 17:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?