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,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top