For example:
[2017-04-14 03:56:22,085109]
If this is the time where event A happens, I want to go 15 minutes before this line in the logfile which will have thousands of line and I want to iterate through everyline in that period and look for specific keywords. Every line in the logfile has the time stamp with the same format.
You can filter the desired lines with a start and end time.
main.pyexample.logBut I recommend you to use python3 (instead of python2).
filterreturns an iterator, instead of the full list.