– 获取所有时间的 cat log.log |grep “压测日志”|awk -F ‘|’ ‘{print $1}’|sort -n| uniq -c – 获取当天的 cat log.log |grep “压测日志”|awk -F ’ |’ ‘{print $1}’|sort -n| uniq -c – 截取某段时间的 cat log.log |grep “压测日志”|awk -F ’ |’ ‘{print $2}’|sort -n| uniq -c – 截取某秒的数量 cat log.log |grep “压测日志”|awk -F ’ |’ ‘{print $2}’ | cut -d ‘:’ -f 2 |sort -n| uniq -c tail -f :取增量 grep :取出cancel这个服务 -F :awk脚本编辑器中设定分隔符” |]”这里我们使用两个分隔符,空格或者]. 上述命令取出时间 15:31:11 cut -d ‘:’ -f 3 取出按分号分割后的第三列即取出秒。 uniq -c: 去重取计数 参考链接: https://blog.csdn.net/lzqinfen/article/details/8986029 https://blog.csdn.net/washCutBlow/article/details/70740367 https://blog.csdn.net/u011003120/article/details/52190187 --------------------- 作者:棒棒糖棠 来源:CSDN 原文:https://blog.csdn.net/u012794505/article/details/81634814 版权声明:本文为博主原创文章,转载请附上博文链接! |
|