#!/usr/bin/python#coding=gb2312res=[];linx=[];f=open('/root/access.log.2');for line in f.readlines(): line.rstrip(); log_home=line.split(); ip=log_home[0]; date=log_home[3].replace('[',''); point=log_home[5].replace('"',''); path=log_home[6]; offer=log_home[8]; linx.append(ip); linx.append(date); linx.append(point); linx.append(path); linx.append(offer); res.append(linx);f.close();print res;