- 论坛徽章:
- 0
|
我想做一个关于查询日志中在一段时间内是否存在某一个字符串的工作 具体的日志形势如下
Sep 19 09:39:19 localhost kernel: imklog 3.22.1, log source = /proc/kmsg started.
Sep 19 09:39:19 localhost rsyslogd: [origin software="rsyslogd" swVersion="3.22.1" x-pid="1565" x-info="http://www.rsyslog.com"] (re)start
Sep 19 09:47:36 localhost firefox: gethostby*.getanswer: asked for "vod.lzu.edu.cn.localdomain", got "wx.redirect.local"
Sep 19 09:47:36 localhost firefox: gethostby*.getanswer: asked for "vod.lzu.edu.cn", got "wx.redirect.local"
Sep 19 11:47:51 localhost kernel: npviewer.bin[7338] general protection ip:116f57c sp:bfddc9c0 error:0 in libflashplayer.so[dfd000+994000]
Sep 19 11:48:10 localhost firefox: gethostby*.getanswer: asked for "vod.lzu.edu.cn", got "wx.redirect.local"
Sep 19 11:49:25 localhost firefox: gethostby*.getanswer: asked for "vod.lzu.edu.cn", got "wx.redirect.local"
Sep 19 11:49:25 localhost firefox: gethostby*.getanswer: asked for "vod.lzu.edu.cn", got "wx.redirect.local"
Sep 19 12:28:35 localhost kernel: npviewer.bin[15863] general protection ip:116f57c sp:bfd1c2c0 error:0 in libflashplayer.so[dfd000+994000]
主要是需要指定处理的日志,开始和结束的时间,指定的字符串,检查这段时间内的日志中是否存在某一个指定的字符串,返回值为真或者假就可以。我是新手,不清楚怎么处理时间这段,各位能帮忙的就麻烦您帮个忙。 |
|