我有访问日志的输出,我需要获取Ip地址及其日期/时间。我面临的问题是,当我需要主要在IP地址上过滤输出并计算它的出现时,如果IP在不同的时间访问我的Web服务器,则我拥有IP的副本,那么我该如何合并日期在这种情况下
sudo zcat /var/log/nginx/access.log.2.gz | awk'{print $ 1“” $ 4“” $ 5}'|排序uniq -c | sort -nr
I expected this
1 77.222.139.* [23/Dec/2018:06:25:17]
1 77.21.47.* [23/Dec/2018:15:21:38]
1 76.231.246.* [23/Dec/2018:21:19:03]
1 71.6.202.* [24/Dec/2018:05:34:20]
2 69.58.178.* [23/Dec/2018:23:01:33]
但是得到了
1 77.222.139.* [23/Dec/2018:06:25:17]
1 77.21.47.* [23/Dec/2018:15:21:38]
1 76.231.246.* [23/Dec/2018:21:19:03]
1 71.6.202.* [24/Dec/2018:05:34:20]
1 69.58.178.* [23/Dec/2018:23:01:33]
1 69.58.178.*[23/Dec/2018:23:01:32]