Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Parse
- def parse
- log = File.new('webserver.log').read
- array = log.scan /["\/"][^\s]+/
- # identify unique strings in array
- # count
- # order by greatness
- array.count(array.uniq[0])
- array.count(array.uniq[1])
- array.count(array.uniq[2])
- array.count(array.uniq[3])
- array.count(array.uniq[4])
- array.count(array.uniq[5])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement