logstash_sqs 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/logstash_sqs/consumer.rb +1 -2
- data/lib/logstash_sqs/version.rb +1 -1
- metadata +2 -2
@@ -39,11 +39,10 @@ class Consumer < EventMachine::FileTail
|
|
39
39
|
|
40
40
|
def format_apache(entry)
|
41
41
|
|
42
|
-
#"%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\""
|
43
42
|
pattern = /^(\S*) (\S*) (\S*) (\S*) (\[[^\]]+\]) (\S*) (\S*) (\S*) (\S*) (\S*) (\S*) (.*)$/
|
44
43
|
if (matcher = pattern.match(entry))
|
45
44
|
|
46
|
-
|
45
|
+
return "{\"@virtual_host\": \"#{matcher[1]}\",\"@remote_host\": \"#{matcher[2]}\",\"@i\": \"#{matcher[3]}\",\"@userid\": \"#{matcher[4]}\",\"@time\": \"#{matcher[5]}\",\"@method\": \"#{matcher[6].gsub('"','')}\",\"@req_path\": \"#{matcher[7]}\",\"@http_version\": \"#{matcher[8].gsub('"','')}\",\"@status\": \"#{matcher[9]}\",\"@size\": \"#{matcher[10]}\",\"@referer\": \"#{matcher[11].gsub('"','')}\",\"@user_agent\": \"#{matcher[12].gsub('"','')}\"}"
|
47
46
|
|
48
47
|
end
|
49
48
|
|
data/lib/logstash_sqs/version.rb
CHANGED