rec 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/lib/rec/correlator.rb +6 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
data/lib/rec/correlator.rb
CHANGED
@@ -101,10 +101,15 @@ class Correlator
|
|
101
101
|
# 2012-04-22 08:43:22.099 EST - Module: ...
|
102
102
|
# otherwise time stands still.
|
103
103
|
def parse(logLine)
|
104
|
-
if logLine =~ /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+(\d+)\s(\d\d)\:(\d\d)\:(\d\d)
|
104
|
+
if logLine =~ /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+(\d+)\s(\d\d)\:(\d\d)\:(\d\d)\s+/
|
105
105
|
# Apr 22 16:40:18 aqua Firewall[205]: Skype is listening from 0.0.0.0:51304 proto=6
|
106
106
|
time = Time.local(@year, $1, $2, $3, $4, $5, 0)
|
107
107
|
message = $'
|
108
|
+
elsif logLine =~ /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+(\d+),\s+(\d{4})\s(\d+)\:(\d\d)\:(\d\d)\s+(AM|PM)\s+/
|
109
|
+
# Oct 1, 2012 1:42:04 PM org.apache.catalina.startup.Catalina start
|
110
|
+
hour = ($7 == "PM") ? ($4.to_i + 12) : $4 # convert PM to 24-hour style
|
111
|
+
time = Time.local($3, $1, $2, hour, $5, $6, 0)
|
112
|
+
message = $'
|
108
113
|
elsif logLine =~ /^\[\w+\]\s(Sun|Mon|Tue|Wed|Thu|Fri|Sat)\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+(\d+)\s(\d\d)\:(\d\d)\:(\d\d)\s(\d{4})/
|
109
114
|
# [err] Fri Dec 30 23:58:56 2011 - scan error: 451 SCAN Engine error 2 ...
|
110
115
|
time = Time.local($7, $2, $3, $4, $5, $6, 0)
|
metadata
CHANGED