I have a written a generator for an apache log which returns two types of
information,
hostname and the filename requested.
The 'log' generator can be 'consumed' like this:
for r in log:
print r['host'], r['filename']
I want to find the top '100' hosts (sorted in descending order of total
requ
sorted(hosts,key=hosts.get, reverse=True):
for file in filename:
print host, all[host,file]
print hosts[host]
I was looking for a better option instead of building 'three' collections
to improve performance.
- Jo
On Wed, Oct 8, 2008 at 2:15 PM, Joe Riopel <[EMAIL PROT
008 4:39:55 PM Maecenas lectus libero, tincidunt sed ]
Note: there is an element corresponding to each time entry in the array
I tried to use the pattern but its not working:
pattern = r'(\d+/\d+/\d+ \d+:\d+:\d+ .+)'
pat = re.compile(pattern)
result = re.split(pat,s)