Rudi Ahlers
2011-Jul-07 12:03 UTC
[CentOS] how to get data from syslog for a specific date range?
Hi all, Can someone please tell me, or point me in the right direction ( I have googled, with little luck) on how to get data from /var/logs/messages (and other log files) for a specified fe days (i.e 19 - 30 June 2011) ? -- Kind Regards Rudi Ahlers SoftDux Website: http://www.SoftDux.com Technical Blog: http://Blog.SoftDux.com Office: 087 805 9573 Cell: 082 554 7532
Owen Beckley
2011-Jul-07 13:28 UTC
[CentOS] how to get data from syslog for a specific date range?
> -----Original Message----- > From: centos-bounces at centos.org [mailto:centos-bounces at centos.org] On > Behalf Of Rudi Ahlers > Sent: Thursday, July 07, 2011 7:04 AM > To: CentOS mailing list > Subject: [CentOS] how to get data from syslog for a specific date > range? > > Hi all, > > Can someone please tell me, or point me in the right direction ( I > have googled, with little luck) on how to get data from > /var/logs/messages (and other log files) for a specified fe days (i.e > 19 - 30 June 2011) ? >Give this a try: grep -E '^Jun (19|2[0-9]|30) ' /var/log/messages And to explain the argument following "-E" see: man grep -- Owen Beckley
m.roth at 5-cent.us
2011-Jul-07 13:44 UTC
[CentOS] how to get data from syslog for a specific date range?
Rudi Ahlers wrote:> Hi all, > > Can someone please tell me, or point me in the right direction ( I > have googled, with little luck) on how to get data from > /var/logs/messages (and other log files) for a specified fe days (i.e > 19 - 30 June 2011) ? >grep "Jul 5" /var/log/messages > 20110705.log or awk '$0 ~ /^Jul [345]/' /var/log/messages > 201107_3-5.log mark