linux通过awk命令,查询日志,分析数据,获取平均时间shell脚本
2017-08-09 16:49
1181 查看
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
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
相关文章推荐
- Windows下bat脚本获取时间和Linux下shell命令获取时间
- 使用shell脚本分析网站日志统计PV、404、500等数据
- shell脚本统计出日志文件操作以及其对应的平均时间
- linux-shell脚本命令之awk
- 通过shell脚本定期删除linux用户下的日志
- shell脚本分析 nginx日志访问次数最多及最耗时的页面(慢查询)
- linux 通过shell脚本在本地执行远程机器命令
- shell 日志分析 获取code的统计——grep awk group功能使用
- shell脚本分析mysql慢查询日志(slow log)
- linux实战(二)----shell脚本监控实例-----日志截取三个命令在性能监控等运用中的实例解析
- shell linux日志分析脚本
- shell脚本获取时间、crontab、日志重定向到文件
- linux中通过date命令获取昨天或明天时间的方法
- linux实战(二)----shell脚本监控实例-----日志截取三个命令在性能监控等运用中的实例解析
- shell脚本分析 nginx日志访问次数最多及最耗时的页面(慢查询)
- linux C程序中获取shell脚本输出(如获取system命令输出)
- linux C程序中获取shell脚本输出(如获取system命令输出)
- 二十. 通过管道组合Shell命令获取系统运行数据:
- shell 定时获取5分钟内的日志数据-------通用脚本(框架)