logdissect is a tool for gaining insight into syslog files. It can merge multiple log files together and sort by timestamp, and filter the results by time range and other criteria. Files that end in .gz or .bz2 are ignored.
1) metadata: logdissect uses file modification times to assign years to syslog date stamps. This allows it to parse logs that span more than one year without a problem. If you are copying log files, always use cp -p (or cp –preserve=timestamps ) and scp -p to preserve original mtimes and other file metadata.
2) –range shortcuts: The range module will fill in your ranges with zeroes if they are shorter than 14 characters. If you want to get a range of 20170204120000 to 20170204130000, you can save time and use 2017020412 and 2017020413.
git clone https://github.com/dogoncouch/logdissect && cd logdissect
manual : python setup.py install
logdissect -v --range=20160202020202-20170227213200 --label=fpath messages debug apache2/error.log