Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
rails plugin for parsing apache log
Ruby
Branch: master
Pull request Compare This branch is 1 commit ahead, 1 commit behind beyond:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
tasks
MIT-LICENSE
README
Rakefile
init.rb
install.rb
uninstall.rb

README

Apache Log Parser
=========

Parsing apache log library for rails.

Example
=======

parse one line

  log = Apache::Log::Combined.parse '127.0.0.1 - - [25/Sep/2008:08:48:38 +0900] "GET /index.html HTTP/1.1" 200 45 "http://localhost/sample.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"'

  puts log.remote_ip    # => "127.0.0.1"
  puts log.time         # => "Thu Sep 25 08:48:38 +0900 2008"

parse file

  Apache::LogFile.foreach( "access.log", :format => :combined, :cache => true ) { |log|
    puts log.time
  }

Copyright (c) 2009 Beyond, released under the MIT license
Something went wrong with that request. Please try again.