Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Can You Figure Out This - Looping

Reply
Thread Tools

Can You Figure Out This - Looping

 
 
Digger
Guest
Posts: n/a
 
      01-05-2005
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


 
Reply With Quote
 
 
 
 
Jim Keenan
Guest
Posts: n/a
 
      01-05-2005
Digger wrote:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
looping in array vs looping in a dic giuseppe.amatulli@gmail.com Python 5 09-20-2012 11:58 PM
Can't figure out where SyntaxError: can not delete variable 'x'referenced in nested scope us coming from in python >=2.6 Albert Hopkins Python 3 12-10-2008 04:10 AM
Asp Error for Exchange Server Attachment. Can you figure this out? J H ASP General 1 05-22-2004 07:03 AM
See if you can figure this one out.... John ASP General 2 09-30-2003 04:33 PM
Lets see if you can figure this out.... Ron ASP General 2 09-29-2003 09:32 PM



Advertisments