gpt4 book ai didi

使用 awk 解析日志条目

转载 作者:行者123 更新时间:2023-12-02 18:28:14 24 4
gpt4 key购买 nike

我收到以下日志:

2013-10-24 18:35:49,728 ERROR [xx.xx.xx.xx.xx.xx] (xx.xx.xx.xx.xx) Manila Olongapo Leyte Tacloban has updated their subscriber details. But, the Regional Account Update interface call has failed for the following Local Registries: <br/>Visayas<br/>Data between LRA and the above Local Registries is out of synch as a result.

我希望结果输入采用以下格式。更好的方法是什么——使用 awksed ?请指教。

$Province$ has updated their subscriber details. However, the Customer Account Update interface call has failed for the following Land Registries:
$Region Name$

最佳答案

仅考虑您的一行示例,只是为了 p̶o̶o̶r̶l̶y̶ 回答你的问题,这里是:

echo '2013-10-24 18:35:49,728 ERROR [xx.xx.xx.xx.xx.xx] (xx.xx.xx.xx.xx) Manila Olongapo Leyte Tacloban has updated their subscriber details. But, the Regional Account Update interface call has failed for the following Local Registries: <br/>Visayas<br/>Data between LRA and the above Local Registries is out of synch as a result.'  | awk '{print $6,$7,$8,$9,$10,$11,$12,$13,$14,"However, the Customer",$18,$19,$20,$21,$22,$23,$24,$25,$26,"Land",$28,substr($29,6,7)}'

关于使用 awk 解析日志条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19967850/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com