#python #python-3.x #apache
#python #python-3.x #apache
Вопрос:
Я пытаюсь извлечь и отсортировать данные из файла журнала Apache, как показано ниже, т.е. общее количество уникальных запросов на основе отдельного IP.
expected result
192.168.10.20: GET=6,POST=3,PUT=3,DELETE=1
43.56.76.4: GET=4,POST=3,PUT=1,DELETE=3
Пример данных журнала, которые я использую.
192.168.10.20 - - [18/Jul/2017:08:41:37 0000] "PUT /search/tag/list HTTP/1.0" 200 5042 "http://cooper.com/homepage/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/5342 (KHTML, like Gecko) Chrome/14.0.870.0 Safari/5342"
10.30.24.3 - - [18/Jul/2017:08:45:15 0000] "POST /search/tag/list HTTP/1.0" 200 4939 "http://www.cole-brown.net/category/main/list/privacy/" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/5322 (KHTML, like Gecko) Chrome/14.0.843.0 Safari/5322"
На данный момент мне удалось получить данные, но я не могу распечатать результат в соответствии с моим требованием. После поиска в Google я нашел скрипт Linux ( grep 'GET' apache_log.log | cut -d' ' -f1 | sort | uniq -c | sort -r
), который частично выдает результаты.
Это мой код, над которым я работал до сих пор,
requestCount = {}
data = open(log_file, "r").readlines()
for lineS in data:
request = lineS.split(" ")[0] " " lineS.split(" ")[5]
requestCount[request] = requestCount.get(request, 0) 1
print(requestCount)
Результат для вышеупомянутого скрипта
{'192.168.10.20 "PUT': 1, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 4, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 4, '74.5.6.5 "GET': 5, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 4, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 2, '43.56.76.4 "GET': 1, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 1, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 1, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1}
{'192.168.10.20 "PUT': 1, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 4, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 5, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 4, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 2, '43.56.76.4 "GET': 1, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 1, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 1, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1}
{'192.168.10.20 "PUT': 1, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 4, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 5, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 4, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 1, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 1, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 1, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1}
{'192.168.10.20 "PUT': 1, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 5, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 5, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 4, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 1, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 1, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 1, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1}
{'192.168.10.20 "PUT': 1, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 5, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 5, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 5, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 1, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 1, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 1, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1}
{'192.168.10.20 "PUT': 1, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 5, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 5, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 5, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 2, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 1, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 1, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1}
{'192.168.10.20 "PUT': 1, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 5, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 5, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 2, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 1, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 1, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1}
{'192.168.10.20 "PUT': 1, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 5, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 2, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 1, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 1, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1}
{'192.168.10.20 "PUT': 1, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 5, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 1, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 1, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1}
{'192.168.10.20 "PUT': 1, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 5, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 1, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1}
{'192.168.10.20 "PUT': 1, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 5, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 1, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1, '94.5.77.98 "PUT': 1}
{'192.168.10.20 "PUT': 1, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 5, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1, '94.5.77.98 "PUT': 1}
{'192.168.10.20 "PUT': 2, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 5, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 5, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1, '94.5.77.98 "PUT': 1}
{'192.168.10.20 "PUT': 2, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 5, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 6, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1, '94.5.77.98 "PUT': 1}
{'192.168.10.20 "PUT': 2, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 6, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 6, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1, '94.5.77.98 "PUT': 1}
{'192.168.10.20 "PUT': 2, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 3, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 6, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1, '94.5.77.98 "PUT': 1}
{'192.168.10.20 "PUT': 2, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 4, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 6, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1, '94.5.77.98 "PUT': 1}
{'192.168.10.20 "PUT': 2, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 6, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 1, '94.5.77.98 "PUT': 1}
{'192.168.10.20 "PUT': 2, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 6, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 1}
{'192.168.10.20 "PUT': 2, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 6, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 6, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 1, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 6, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 3, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 4, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 2, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 4, '94.5.6.3 "POST': 3, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 4, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 1, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 4, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 1, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 4, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 4, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 5, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 4, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 4, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 5, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 5, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 4, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 5, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 5, '94.5.6.3 "GET': 7, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 6, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 4, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 5, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 5, '94.5.6.3 "GET': 8, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 6, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 6, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 4, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 5, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 5, '94.5.6.3 "GET': 8, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 6, '74.5.6.5 "GET': 6, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 7, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 4, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 5, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 5, '94.5.6.3 "GET': 8, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 6, '74.5.6.5 "GET': 7, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 7, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 4, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 5, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 5, '94.5.6.3 "GET': 8, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 6, '74.5.6.5 "GET': 7, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 7, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 5, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 5, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 5, '94.5.6.3 "GET': 8, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 6, '74.5.6.5 "GET': 7, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 8, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 5, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 5, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 6, '94.5.6.3 "GET': 8, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 6, '74.5.6.5 "GET': 7, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 8, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 5, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 5, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 6, '94.5.6.3 "GET': 8, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 6, '74.5.6.5 "GET': 7, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 8, '192.168.10.20 "POST': 2, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 5, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 5, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2, '192.168.10.20 "DELETE': 1}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 6, '94.5.6.3 "GET': 8, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 6, '74.5.6.5 "GET': 7, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 8, '192.168.10.20 "POST': 3, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 5, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 5, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2, '192.168.10.20 "DELETE': 1}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 6, '94.5.6.3 "GET': 8, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 7, '74.5.6.5 "GET': 7, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 5, '43.56.76.4 "PUT': 8, '192.168.10.20 "POST': 3, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 5, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 5, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2, '192.168.10.20 "DELETE': 1}
{'192.168.10.20 "PUT': 3, '10.30.24.3 "POST': 1, '98.5.45.3 "GET': 6, '94.5.6.3 "GET': 8, '34.5.66.7 "POST': 2, '43.56.76.4 "DELETE': 1, '34.5.66.7 "GET': 7, '74.5.6.5 "GET': 7, '94.5.77.98 "DELETE': 1, '192.168.10.20 "GET': 6, '43.56.76.4 "PUT': 8, '192.168.10.20 "POST': 3, '10.30.24.3 "DELETE': 1, '74.5.6.5 "PUT': 4, '43.56.76.4 "GET': 5, '94.5.6.3 "POST': 4, '74.5.6.5 "DELETE': 1, '94.5.77.98 "GET': 7, '98.5.45.3 "POST': 2, '10.30.24.3 "GET': 5, '98.5.45.3 "PUT': 2, '34.5.66.7 "PUT': 1, '94.5.77.98 "POST': 2, '10.30.24.3 "PUT': 3, '94.5.6.3 "PUT': 2, '74.5.6.5 "POST': 2, '94.5.6.3 "DELETE': 1, '98.5.45.3 "DELETE': 2, '94.5.77.98 "PUT': 2, '192.168.10.20 "DELETE': 1}
Теперь я застрял.
Комментарии:
1. Просто удалите отступ в последней строке:
print(requestCount)
таким образом, вы заставите его печатать только после завершения цикла for
Ответ №1:
Ожидаемый результат может быть представлен в виде вложенных dicts. Пример:
{
'192.168.10.20': {
'GET': 6,
'POST': 3,
'PUT': 3,
'DELETE': 1
},
'43.56.76.4': {
'GET': 4,
'POST': 3,
'PUT': 1,
'DELETE': 3
}
}
Начальная логика вашего скрипта в порядке, но вместо использования ip " " method
в качестве ключей в RequestCount вам следует использовать ip в качестве ключа и вложенный dict в качестве значения. Этот вложенный dict будет содержать ваши подсчеты для каждого метода.
requestCount = {}
data = open(log_file, "r").readlines()
for line in data:
lineParts = line.split(" ")
ip = lineParts[0]
method = lineParts[5]
if ip not in requestCount:
requestCount[ip] = {}
if method not in requestCount[ip]:
requestCount[ip][method] = 0
requestCount[ip][method] = 1
print(requestCount)