[Ilugc] Proxy

  • From: scuffy_tomy@xxxxxxxxxxx (kannan manoharan)
  • Date: Wed Aug 23 18:29:54 2006


Hi 
 
 I am getting a error when run the script with comment or without comment 
 
"linestr = myfile.readline()" this line

error is :

 
 =:           cannot open `=' (No such file or directory)
 sys.argv[1]: cannot open `sys.argv[1]' (No such file or directory)
 squid: line 5: syntax error near unexpected token `('
 squid: line 5: `myfile = open(file, 'r')'
 
 tell me what to do in this regards ?
 
 Kannan M
 
Senthil Kumaran S <stylesen@xxxxxxxxx> wrote: On 8/21/06, kannan manoharan  
wrote:

 Is there any command or any solution for this ?

Just a small python script which retrives the URLs from the access.log file:

--------------------------------------------------------------------------------------------------------------
import re
import sys

file = sys.argv[1]
myfile = open(file, 'r')

p = re.compile(r'.*\"(.*)\".*',re.S)

for linestr in myfile.readlines():
    m = p.match(linestr)
    if m == None:
        pass
    else:
        print m.group(1)

    linestr = myfile.readline()

myfile.close()
-----------------------------------------------------------------------------------------------------------------

The above will filter only the URLs from access.log and prints. Pass
access.log file's localtion as command line argument to this script :)

-- 
--sen--
Be a man of Deeds
Don't be a man of Needs...
http://stylesen.blogspot.com
http://geocities.com/sen_kavithai
_______________________________________________
To unsubscribe, email ilugc-request@xxxxxxxxxxxxx with 
"unsubscribe 
 
"
in the subject or body of the message.  
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


                                
---------------------------------
 Here's a new way to find what you're looking for - Yahoo! Answers 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it 
NOW

Other related posts: