Skip to content

Commit

Permalink
Field $10 can be "-" as well as a number. Treat as string.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjwierenga committed Nov 30, 2010
1 parent 8b4d87a commit f84b11e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ralf.rb
Expand Up @@ -148,9 +148,9 @@ def self.convert_to_common_log_format(input_log, output_log)
def self.translate_to_clf(line)
if line =~ AMAZON_LOG_FORMAT
# host, date, ip, acl, request, status, bytes, agent = $2, $3, $4, $5, $9, $10, $12, $17
"%s - %s [%s] \"%s\" %d %s \"%s\" \"%s\"" % [$4, $5, $3, $9, $10, $12, $16, $17]
"%s - %s [%s] \"%s\" %s %s \"%s\" \"%s\"" % [$4, $5, $3, $9, $10, $12, $16, $17]
elsif line =~ AMAZON_LOG_FORMAT_COPY
"%s - %s [%s] \"%s\" %d %s \"%s\" \"REST.COPY.OBJECT_GET\"" % [$4, $5, $3, "POST /#{$8} HTTP/1.1", $10, $12, $16]
"%s - %s [%s] \"%s\" %s %s \"%s\" \"REST.COPY.OBJECT_GET\"" % [$4, $5, $3, "POST /#{$8} HTTP/1.1", $10, $12, $16]
else
$stderr.puts "# ERROR: #{line}"
nil
Expand Down

0 comments on commit f84b11e

Please sign in to comment.