Compare commits

..

No commits in common. "90e7dd49e19c9641c12eafec3812abd67adff1f5" and "d13fd49d51fc4ca54cb89ff3fbeebb98c5500ae6" have entirely different histories.

2 changed files with 0 additions and 34 deletions

View File

@ -1,11 +0,0 @@
#!/usr/bin/python3
import sys
import re
regexp = '^(\S+) (\S+) (\S+) \[([^]]+)\] "(\w+) (\S+).*" (\d+) (\S+)'
for line in sys.stdin:
line = line.rstrip ()
match =re.match (regexp, line)
if match :
print (match.group(1)," ",match.group(8))
# for line in

View File

@ -1,23 +0,0 @@
#!/usr/bin/python3
import sys
import re
cptip = {}
regexp = '^(\S+) (\S+) (\S+) \[([^]]+)\] "(\w+) (\S+).*" (\d+) (\S+)'
for line in sys.stdin:
line = line.rstrip ()
match =re.match (regexp, line)
if match :
print (match.group(1)," ",match.group(8))
#print {match.group(1)}
ip = match.group(1)
vol = int(match.group(8))
if ip in cptip :
cptip[ip] = cptip[ip] + vol
else:
cptip[ip] = vol
for key in cptip.keys():
print(key, ":", cptip[key])