发布于 2020-08-31 06:57:47
从Rapid7 OpenData下载JSON
$ wget https://opendata.rapid7.com/sonar.https/2020-07-26-1595771130-https_get_50880.json.gz提取'ip‘和'port’字段
$ zcat 2020-07-26-1595771130-https_get_50880.json.gz | jq '.ip,.port' | head
"73.71.198.224"
50880
"3.228.14.207"
50880
"175.139.245.229"
50880
"162.208.16.163"
50880
"58.58.213.88"
50880提取'ip:port‘格式的字段
zcat 2020-07-26-1595771130-https_get_50880.json.gz | jq -r '"\(.ip):\(.port)"' | head
73.71.198.224:50880
3.228.14.207:50880
175.139.245.229:50880
162.208.16.163:50880
58.58.213.88:50880
18.130.113.90:50880
54.216.22.17:50880
15.236.60.123:50880
77.54.234.109:50880
71.37.173.187:50880感谢@peak的改进!
https://stackoverflow.com/questions/63662634
复制相似问题