I'm the following log file structure. I want to find out the maximum response time and want to print the log file which is having the highest response time(R.T) using python 2.7.11.
The structure of my log file:
00.00.00.000 - - [dd/mm/yyyy:hr:mm:se +0800] GET Url HTTP/1.1 200 dataconsumed R.T
00.00.00.000 - - [dd/mm/yyyy:hr:mm:se +0800] GET Url HTTP/1.1 200 dataconsumed R.T
00.00.00.000 - - [dd/mm/yyyy:hr:mm:se +0800] GET Url HTTP/1.1 200 dataconsumed R.T
Code Used:
file =open(r"log.txt","r")
for line in file:
line_array = line.split(" ")
print line_array[10]
OUTPUT:
R.T
R.T
R.T
Until now I could able to print all the response time from the log file. I couldn't able to get the highest response time (R.T) out of it.
Help me to find the highest response time with the whole log file printed as an output.