squid日志时间是unix时间戳 不利于观看 python脚本进行转换
1 #!/usr/bin/env python 2 #2014-6-5 pdd 3 4 import re 5 import time 6 import sys 7 8 with open(sys.argv[1],'r') as f: 9 log = re.findall(r'S+',f.readline()) 10 while log: 11 print "[%s] %s" % (time.strftime("%T %D",time.localtime(float(log[0]))),' '.join(log[1:])) 12 log = re.findall(r'S+',f.readline())
./time_convert *.log