[NTLUG:Discuss] process last 'x' minutes of log entries?

Jack Snodgrass jack at jacksnodgrass.com
Sat Sep 27 07:22:24 CDT 2003


I want to grep/egrep/scan/process/etc the last 'x' minutes of log
entries
from something like /var/log/messages. 

I can do a tail -n5000 /var/log/messages and get the last 5000 lines, 
but I want to be able to get the last 30 minutes and not try and find 
where they are in the log. 

Does anyone know of any existing utilites / things that will do this?

I could write a program that ran all of the time and did something like

tail -f /var/log/messages
do
wait 'x' minutes
process the log entries
loop

but I'd like to see if there is something already that does this. 

Thanks - jack 


More information about the Discuss mailing list