如何获取Apache日志文件中每个IP地址的唯一请求总数

时间:2019-04-02 17:26:19

标签: 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"

到目前为止,我已设法获取数据,但无法按照我的要求打印结果。谷歌搜索之后,我发现了一个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 个答案:

答案 0 :(得分:0)

预期结果可以表示为嵌套字典。示例:

{
    '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作为键,而应使用ip作为键,并使用嵌套的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)