【发布时间】:2020-03-15 20:43:21
【问题描述】:
我正在尝试从 IP 列表中删除 /32 该列表是导出的 14 列。 IP 地址在第 9 和 11 列中
我尝试使用 sed:sed 's_/32__' filename
但这留下了大量的 x.x.x.x/32 行。
喜欢;172.16.16.160/32;22;TCP
所以我正在考虑使用 awk 选择第 9 和 11 列并通过 sed 将其通过管道传输,但这最终会导致混乱和错误。
只剪掉 / 后面的所有内容是行不通的,因为列表中还有 url。
任何帮助将不胜感激。
下面已经运行 sed 的(匿名)数据样本:
timestamp (UTC);ID;Threat Level;Category;Exporter IP address;Observation domain ID (ODID);Source MAC;Manufacturer;Source IP;Source Port;Destination IP;Destination Port;Protocol;Description
2020-03-14 13:54:10;20810;5;Ingress Traffic;::ffff:ac8:c8d0/128;101;00:10:8c:f0:cx:c0;Intel;8.8.8.8/32;49420;10.0.0.1/32;22;TCP;Ingress connection to common SSH port: 100% CertaintyHigh Severity Category: SSH Description: Shh
【问题讨论】: