Can You Figure Out This - Looping

D

Digger

Ok...... I am new at perl, have been at it for a week or so now
learning.........

I am trying to do the following....

I have a log (url.log) file that contains various url's and some of
them have errors (indicated with a "FAILURE" in the log file).... Now
I want to extract these url's that have the "FAILURE".

log file format

date : error message : url


The problem is this file gets updated every 10 minutes, and in that
time the url could become valid.......

example:

2004-12-24 FAILURE www.bla.com
2004-12-24 SUCCESS www.bla.com
..........

So from the above example the url is valid and I would like a 0 sent
to a file........

2004-12-24 FAILURE www.bla.com
2004-12-24 SUCCESS www.aaa.com
2004-12-24 FAILURE www.aaa.com
2004-12-24 SUCCESS www.bla.com
2004-12-24 FAILURE www.123.com
2004-12-24 FAILURE www.bla.com

Now the url has failed and I would like a 1 sent to a file.....

So we are checking a log file for failed urls that have also not
corrected themselves......... Some sort of loop I would imagine, I
couldn't figure it out... lol
 
J

Jim Keenan

Digger said:
Ok...... I am new at perl, have been at it for a week or so now
learning.........

I am trying to do the following....

I have a log (url.log) file that contains various url's and some of
them have errors (indicated with a "FAILURE" in the log file).... Now
I want to extract these url's that have the "FAILURE".

log file format

date : error message : url


The problem is this file gets updated every 10 minutes, and in that
time the url could become valid.......

example:

2004-12-24 FAILURE www.bla.com
2004-12-24 SUCCESS www.bla.com
.........

So from the above example the url is valid and I would like a 0 sent
to a file........

2004-12-24 FAILURE www.bla.com
2004-12-24 SUCCESS www.aaa.com
2004-12-24 FAILURE www.aaa.com
2004-12-24 SUCCESS www.bla.com
2004-12-24 FAILURE www.123.com
2004-12-24 FAILURE www.bla.com

Now the url has failed and I would like a 1 sent to a file.....

So we are checking a log file for failed urls that have also not
corrected themselves......... Some sort of loop I would imagine, I
couldn't figure it out... lol
Please show us the Perl code you have tried so far.

jimk
 

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

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top