日志时间段截取
本帖最后由 wenxin1234114 于 2011-06-07 16:17 编辑
日志时间段截取,比如我想取Feb 22到Jun 7号之间的日志,如何取,谢谢。
格式如下:
Tue Feb 22 11:12:11 2011 - [12387] (60.249.27.250) salesshenrong - login error - no such user - loginname=salesshenrong
Tue Feb 22 12:19:19 2011 - [20452] (218.32.83.158) def- login - chern-yih*def-session-0.322321050658019 - active=0,0,0
Tue Feb 22 13:06:08 2011 - [25588] (125.227.186.36) def- login - chern-yih*def-session-0.740185391713993 - active=0,1,1
Tue Feb 22 14:01:22 2011 - [32468] (125.232.99.234) def - login - def*def-session-0.707055271227972 - active=1,1,1
Tue Jun 7 14:01:22 2011 - [32468] (125.232.99.234) def - login - def*def-session-0.707055271227972 - active=1,1,1
日志时间段截取,比如我想取Feb 22到Jun 7号之间的日志,如何取,谢谢。
格式如下:
Tue Feb 22 11:12:11 2011 - [12387] (60.249.27.250) salesshenrong - login error - no such user - loginname=salesshenrong
Tue Feb 22 12:19:19 2011 - [20452] (218.32.83.158) def- login - chern-yih*def-session-0.322321050658019 - active=0,0,0
Tue Feb 22 13:06:08 2011 - [25588] (125.227.186.36) def- login - chern-yih*def-session-0.740185391713993 - active=0,1,1
Tue Feb 22 14:01:22 2011 - [32468] (125.232.99.234) def - login - def*def-session-0.707055271227972 - active=1,1,1
Tue Jun 7 14:01:22 2011 - [32468] (125.232.99.234) def - login - def*def-session-0.707055271227972 - active=1,1,1
作者: wenxin1234114 发布时间: 2011-06-07
本帖最后由 jason680 于 2011-06-07 15:40 编辑
须求不明....
grep -oP "^.+?\d{4}"
须求不明....
grep -oP "^.+?\d{4}"
作者: jason680 发布时间: 2011-06-07