我有一个看起来像这样的日志文件:
www.domainone.com FIX 3.3 12.12.123.1
www.domainone.com FIX 3.4 12.12.123.1
www.domainone.com FIX 2.4 12.12.123.1
www.domaintwo.com MAX 1.4 44.15.153.5
www.domaintwo.com MAX 3.2 44.15.153.5
www.domaintwo.com MAX 3.9 44.15.153.5
www.domaintwo.com MAX 12.4 44.15.153.5
www.domainthree.com NAN 3.4 34.45.144.7
www.domainthree.com NAN 2.4 34.45.144.7
www.domainthree.com NAN 3.2 34.45.144.7
www.domainthree.com NAN 3.3 34.45.144.7
www.domainthree.com NAN 1.4 34.45.144.7
我想运行一个 grep、awk、sed 或其他 bash 命令/脚本,该命令/脚本将按最后一列拆分该日志文件,因此结果是 3 个使用 IP 命名的日志文件,不带点。所以,其中之一是 34.45.144.7.log 并且有
www.domainthree.com NAN 3.4 34.45.144.7
www.domainthree.com NAN 2.4 34.45.144.7
www.domainthree.com NAN 3.2 34.45.144.7
www.domainthree.com NAN 3.3 34.45.144.7
www.domainthree.com NAN 1.4 34.45.144.7
我能够使用 awk 对它们进行排序并从原始日志中删除一些列,但不知道如何使用一列拆分为文件。