- 論壇徽章:
- 0
|
我想做一個(gè)關(guān)于查詢?nèi)罩局性谝欢螘r(shí)間內(nèi)是否存在某一個(gè)字符串的工作 具體的日志形勢(shì)如下
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]
主要是需要指定處理的日志,開(kāi)始和結(jié)束的時(shí)間,指定的字符串,檢查這段時(shí)間內(nèi)的日志中是否存在某一個(gè)指定的字符串,返回值為真或者假就可以。我是新手,不清楚怎么處理時(shí)間這段,各位能幫忙的就麻煩您幫個(gè)忙。 |
|