#coding=utf-8
Result=open('result.txt',"w")
FileTunnel = open('tunnel.txt').readlines()
New_dict = {}
UpSum=0
DownSum=0
#NumBer=0 #计数次数
for Line in FileTunnel:
#print Line Protocol = Line.split()[6]
OriginalIp = Line.split()[8]
UpLoad = Line.split()[10]
DownLoad = Line.split()[11]
Type = Line.split()[20]
Domain = Line.split()[21]
if New_dict.has_key(OriginalIp):
#NumBer+=1
UpSum+=int(UpLoad)
DownSum+=int(DownLoad)
UpDictValue = Protocol,OriginalIp,UpSum,DownSum,Type,Domain,int(New_dict[OriginalIp][6])+1
New_dict[OriginalIp] = UpDictValue
#print OriginalIp,int(New_dict[OriginalIp][2]),int(New_dict[OriginalIp][3])
continue
#print New_dict[OriginalIp],UpSum,DownSum
DictValue = Protocol,OriginalIp,UpLoad,DownLoad,Type,Domain,1
New_dict[OriginalIp] = DictValue
#print "OUTPUT:",DictValue
#print New_dict["222.186.3.50:80"]
for x,y in New_dict.items():
Result.writelines(str(y)+' ')