linux日志包含字段,Linux中awk抽取包含某字段的整行日志

https://blog.csdn.net/hgg923/article/details/51376295

命令示例:

awk '{if($0~"listAuths") print}' xxx.log

解释说明:抽取xxx.log整个日志文件中,包含“listAuths”的行,打印输出

抽取效果:

[root@SZB-L0005724 applogs]# awk '{if($0~"listAuths") print}' csp_iobs_core_trace.log.2016-04-27

[INFO ] [2016-04-27 17:40:14] com.pingan.iobs.core.aspect.ControllerAspect -  listAuths finished! cost: 4ms. args : listAuths'args :

[INFO ] [2016-04-27 17:41:13] com.pingan.iobs.core.aspect.ControllerAspect -  listAuths finished! cost: 5ms. args : listAuths'args :

[INFO ] [2016-04-27 17:45:14] com.pingan.iobs.core.aspect.ControllerAspect -  listAuths finished! cost: 5ms. args : listAuths'args :

[INFO ] [2016-04-27 17:50:15] com.pingan.iobs.core.aspect.ControllerAspect -  listAuths finished! cost: 5ms. args : listAuths'args :

[INFO ] [2016-04-27 17:55:15] com.pingan.iobs.core.aspect.ControllerAspect -  listAuths finished! cost: 5ms. args : listAuths'args :

[INFO ] [2016-04-27 18:00:16] com.pingan.iobs.core.aspect.ControllerAspect -  listAuths finished! cost: 5ms. args : listAuths'args :

[INFO ] [2016-04-27 18:05:16] com.pingan.iobs.core.aspect.ControllerAspect -  listAuths finished! cost: 4ms. args : listAuths'args :

详解:http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858470.html

————————————————

版权声明:本文为CSDN博主「多来哈米」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。

原文链接:https://blog.csdn.net/hgg923/article/details/51376295

标签:core,27,某字,04,com,args,整行,awk,listAuths

来源: https://blog.csdn.net/Gavid0124/article/details/100920331

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值