rec 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/CHANGELOG +3 -0
  2. data/lib/rec/correlator.rb +6 -1
  3. metadata +3 -3
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ === version 1.2.1
2
+ - Recognise more date patterns
3
+
1
4
  === Version 1.2.0
2
5
  - fixed defects in sending mail
3
6
  - fixed defect in correlator's time recognition
@@ -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
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rec
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 0
10
- version: 1.2.0
9
+ - 1
10
+ version: 1.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Richard Kernahan