Enriched Details of Apache Common Log Format
See Apache Log Parsing for the background.
Here's a generator function which expands a simple Access to be a more detailed named tuple.
Access_Details= namedtuple( 'Access_Details',
['access', 'time', 'method', 'url', 'protocol'] )
def details_iter( iterable ):
def parse_time_linux( ts ):
return datetime.datetime.strptime( ts, "%d/%b/%Y:%H:%M:%S %z" )
def …
more ...