将文件中的有Start和End行截出来,取其中的日期后,用end日志减去start日期
for i in `ls server.log*` ; do
echo $i
grep -E "CMSContentSyncServlet\.process\(\)\ Start| CMSContentSyncServlet\.process\(\)\ End" server.log | awk -F'|' '{gsub("-"," ",$2);gsub(":"," ",$2);if($5~"End") end[++a]=mktime($2)+0; else if($5~"Start") start[++b]=mktime($2)+0 } END{for(i=1;i<=a;i++) print "end-start="end[i]-start[i]}'
done
阅读(1074) | 评论(0) | 转发(0) |