import timea=0while True: d={} f = open(r"/Users/**juan/Downloads/access.log",encoding="utf-8") f.seek(a) for line in f: if line.split() !="": f1=line.split(" ")[0] if f1 not in d: d[f1]=1 else: d[f1] += 1 a=f.tell() print() for f1 in d: if d.get(f1) > 100: print(" %s 出现的次数超过100次"%f1) time.sleep(60)
原文地址:https://www.cnblogs.com/fandonghua/p/11586600.html
时间: 2024-10-09 02:37:03