Want to get last 24 hours data from a log file
Hi,
I have a log file, which has data similar to : [2011-11-11 00:33:53,962] xyz [2011-11-21 01:28:01,269] abc [2011-11-30 00:52:56,444] bcd I want to be able to pull out data that is less than 24 hurs old from this file, so that on a daily basis i can get a report having data of last 24 hours. Could you please let me know, using unix, how can i filter the data that i need ? |
Quote:
You can also use logrotate, and have it set to archive log files every day, so that your logs will only EVER have 24 hours of data in them, going back as far as you'd like. Read the man pages on grep and logrotate. |
All times are GMT -5. The time now is 05:54 AM. |