Take the 2-minute tour ×

I'm very new to iPython and doing some experiments with the following post.


In [10]: Parsing the log file in to data dictionary does not work. Can somebody please help me to figure out this?.

log_list = []
for line in log:
          data = p.parse(line)
          sys.stderr.write("Unable to parse %s" % line)
       data['%t'] = data['%t'][1:12]+' '+data['%t'][13:21]+' '+data['%t'][22:27]


could someone plese try up to this point and let me know what is the error with this code?

share|improve this question
what doesn't work? what is the exact error you are getting? remove the except block and post the complete stacktrace? are you sure your log format is correct? are you using apachelog? –  dm03514 May 2 '13 at 12:12
yes,i'm using the sample data he has provided. But it says unable to parse. I have tried without the except and it also not working. dl.dropboxusercontent.com/u/107639/notebooks/… –  Nilani Algiriyage May 2 '13 at 12:20
can some one please help me? –  Nilani Algiriyage May 2 '13 at 12:52
add comment


Your Answer



Browse other questions tagged or ask your own question.