class RequestLogAnalyzer::FileFormat::Apache::Request

Define a custom Request class for the Apache file format to speed up timestamp handling.

Constants

MONTHS

Public Instance Methods

category() click to toggle source
    # File lib/request_log_analyzer/file_format/apache.rb
117 def category
118   first(:path)
119 end
convert_timestamp(value, _definition) click to toggle source

Do not use DateTime.parse, but parse the timestamp ourselves to return a integer to speed up parsing.

    # File lib/request_log_analyzer/file_format/apache.rb
126 def convert_timestamp(value, _definition)
127   "#{value[7, 4]}#{MONTHS[value[3, 3]]}#{value[0, 2]}#{value[12, 2]}#{value[15, 2]}#{value[18, 2]}".to_i
128 end
convert_user_agent(value, _definition) click to toggle source

This function can be overridden to simplify the user agent string for better categorization in the reports

    # File lib/request_log_analyzer/file_format/apache.rb
132 def convert_user_agent(value, _definition)
133   value # TODO
134 end