I am creating a python script to analyze a log file(example: http://www.monitorware.com/en/logsamples/apache.php ) and needs suggestions of methods that I can use to achieve this.
open
method. OK. 64.242.88.10 - - [07/Mar/2004:16:05:49 -0800] "GET /twiki/bin/edit/Main/Double_bounce_sender?topicparent=Main.ConfigurationVariables HTTP/1.1" 401 12846
How do I count elapsed time after a certain position like year in this case? I'd use re
module to extract information from text (search, substr, etc.).
Then strptime
could be your friend to convert those date-time values to datetime and do calculations on them.
After that I'd use numpy.ndarray
to store the data and generate further reports.
I also like matplotlib
and features like hist
to make some nice plots.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.