- 论坛徽章:
- 15
|
本帖最后由 rdcwayx 于 2013-10-15 13:16 编辑
回复 4# 我爱大桃 - tail -100f infile |awk '/------/{t=id=num="";printf RS}/MO message queue/{split($2,a,":");t=a[1]":"a[2]":"a[3];id=$NF}/: queue /{gsub(/[][]/,"",$NF);num+=$NF;printf "\r%-20s%-20s%-20s",t,id,num}' OFS="\t"
复制代码 我用来测试的输入文件是这样的,里面的中文都给替换了:- $ cat infile
- <2013/09/16 09:54:11:539000(347:47235084696480)INFO>: -----------------------------
- <2013/09/16 13:07:40:177026(1650:47026108042144)INFO>: | system data:
- <2013/09/16 13:07:40:177039(1650:47026108042144)INFO>: | MO message queue: [2194731]
- <2013/09/16 13:07:40:188925(1650:47026108042144)INFO>: KKK[902601]: queue [404]
- <2013/09/16 13:07:40:188927(1650:47026108042144)INFO>: KKK[902602]: queue [404]
复制代码 |
|