This commit is contained in:
Raphanaud 2021-10-06 09:18:32 +02:00
parent 6fbf265e6e
commit 7cc40880fc
2 changed files with 189778 additions and 0 deletions
sio2/sisr/35-script/python

File diff suppressed because it is too large Load Diff

@ -0,0 +1,19 @@
#/usr/bin/python3
import re
import sys
group = {}
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))
ip = match.group(1)
vol = match.group(8)
if ip in group:
group[ip] = group[ip] + vol
else:
group[ip] = vol
for key in group.keys():
print (key, " ", group[key])