Menu

#20 Exception in parse.py with long lines

open
nobody
None
5
2004-03-29
2004-03-29
Greg Cooper
No

Occasionally I get lines in my access_log that look like:
ip - - [27/Mar/2004:10:32:49 -0500] "SEARCH
/~P^B�^B�^B..." 414 360 "-" "-"

With ... being a lot of the same charcters (a little
over 8000). This cause an exception (recursion limit
reached) in process_log when it is trying to parse the
line. I fixed this by modifying the search line as
follows:
try:
m = self.log_format_compiled.search(line)
except Exception, e:
print "Unparsed line ", line
print e
continue

I

Discussion


Log in to post a comment.