目前因發生了異常大概記得發生的時間段,想查看這個時間段的日誌html
1:09:59.946 [http-nio-12129-exec-10] INFO ntroller start ==== 11:09:59.946 [http-nio-12129-exec-10] INFO .BannerInfoService - ===== getBannerInfoList start========== 11:09:59.947 [http-nio-12129-exec-10] INFO vice.BannerInfoService - ===== getBannerInfoList end========== 11:09:59.947 [http-nio-12129-exec-10] INFO .controller.DriverBaseController - ==== GetBannerInfoController end ==== 11:09:59.947 [http-nio-12129-exec-10] INFO er.a
注意的部分:spa
1) . 開始時間和結束時間必須是日誌裏面有的,要是沒有開始的時間,那就是查找沒有結果,要是沒有結束時間,查詢的結果就是開始時間到最後的所有日誌日誌
2). 時間後面的p不能省略code
$ sed -n '/11:10:*/,/11:20*/p' dongfeng-driver-core.2019-10-25.log | grep 超時 11:10:20.895 [http-nio-12129-exec-2] INFO allFeign - feign response body : HttpCommandResultWithData{data=null} CommonResult{resultCode=408, message='請求超時'} 11:10:20.896 [http-nio-12129-exec-2] INFO cAop - RESPONSE : HttpCommandResultWithData{data=null} CommonResult{resultCode=408, message='請求超時'} 11:16:26.696 [http-nio-12129-exec-1] INFO coForCallFeign - feign response body : HttpCommandResultWithData{data=null} CommonResult{resultCode=408, message='請求超時
total 31172
-rw-rw-r-- 1 prodfcv1 prodfcv1 14608 Oct 25 11:35 11.txt
drwxrwxr-x 2 prodfcv1 prodfcv1 6 May 6 2018 baklog
參考博客:http://www.javashuo.com/article/p-auawfwee-dy.html