monitor unix file for string

J

jamesjesse68

Hello,

I have a requirement to monitor a log file in unix using perl 5.8.
Needed is detection of "error" in a line appended to the file.
Also need to detect if "complete" is not found after, say, 5 hours
after invocation.

I expect there is a hard way and an easy way to do this - could some
kind person advise me?
Pointers to Fine Perldocs welcome!

TIA

JJ
 
J

Josef Moellers

Hello,

I have a requirement to monitor a log file in unix using perl 5.8.
Needed is detection of "error" in a line appended to the file.
Also need to detect if "complete" is not found after, say, 5 hours
after invocation.

I expect there is a hard way and an easy way to do this - could some
kind person advise me?
Pointers to Fine Perldocs welcome!


perldoc -q tail

How do I do a "tail -f" in perl?

HTH,

Josef
 
P

Peter Makholm

Hello,

I have a requirement to monitor a log file in unix using perl 5.8.
Needed is detection of "error" in a line appended to the file.

'perldoc -q tail'
Also need to detect if "complete" is not found after, say, 5 hours
after invocation.

'perldoc -f alarm'

might be two useful pointers.

//Makholm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top