linux通过awk命令,查询日志,分析数据,获取平均时间shell脚本

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zl386119974/article/details/77001795

linux通过awk命令,查询日志,分析数据,获取平均时间shell脚本

find ./ -name "merGuanWeb.log*" |xargs grep 'ProductSearchService:searchClient|execute|costs' | awk '{split($0,a,":");sum +=a[8];average = sum/NR;print a[8]}END {print "sum = " sum; print "average = " sum/NR}'

参考:http://www.cnblogs.com/sunada2005/p/3493941.html

http://blog.csdn.net/robertsong2004/article/details/41683761

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


猜你喜欢

转载自blog.csdn.net/zl386119974/article/details/77001795
今日推荐