nais-log-parser 0.13.2 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nais/log/parser.rb +10 -6
- data/lib/nais/log/parser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b83a347aff499ef4708f4f41c142382f0e8da847
|
4
|
+
data.tar.gz: 1fc518ce15015f3626060fd4e62c3a3218a8cffe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d991a45c39de1751d27bd18a544b53d72b79794ea20c560b373615a02000ef4c94aaf511c53c36d436c6ed088c8e4ec546c23e35047a642ec32eb40d03d023d1
|
7
|
+
data.tar.gz: e9ba93174d6c27b2cbece3c9b0a4f102d1a9a54f2bb8afe008caefe55ebb5c6190cf5f9ac476074b030a2298c17d334956a08dbff2c017c61ee4e6fdbe3cc24c
|
data/lib/nais/log/parser.rb
CHANGED
@@ -149,25 +149,29 @@ module Nais
|
|
149
149
|
|
150
150
|
def Parser.parse_influxdb(str)
|
151
151
|
if m = str.match(/^\[([^\]]+)\] (.*)$/)
|
152
|
-
comp = m[1]
|
153
|
-
log = m[2]
|
154
152
|
r = {}
|
153
|
+
comp = m[1]
|
154
|
+
msg = m[2]
|
155
155
|
if comp == 'httpd'
|
156
|
-
ar, ext = parse_accesslog(
|
156
|
+
ar, ext = parse_accesslog(msg)
|
157
157
|
unless ar.nil?
|
158
158
|
r = ar
|
159
|
+
r['message'] = r.delete('request')
|
159
160
|
if !ext.nil? && m = ext.match(/^ \"([^\"]+)\" \"([^\"]+)\" ([0-9a-f-]+) (\d+)$/)
|
160
161
|
r['referer'] = m[1] unless m[1] == '-'
|
161
162
|
r['user_agent'] = m[2] unless m[2] == '-'
|
162
|
-
r['
|
163
|
+
r['request'] = m[3] unless m[3] == '-'
|
163
164
|
r['processing_time'] = m[4] unless m[4] == '-'
|
164
165
|
end
|
165
166
|
end
|
166
167
|
end
|
167
|
-
|
168
|
+
r['component'] = comp
|
169
|
+
if m = msg.match(/^(\d{4}\/\d\d\/\d\d \d\d:\d\d:\d\d) (.*)/)
|
168
170
|
r['timestamp'] = Time.strptime(m[1]+"+00:00", "%Y/%m/%d %H:%M:%S%Z").iso8601
|
171
|
+
r['message'] = m[2]
|
172
|
+
elsif r['message'].nil?
|
173
|
+
r['message'] = msg
|
169
174
|
end
|
170
|
-
r['component'] = comp
|
171
175
|
return r
|
172
176
|
else
|
173
177
|
return nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nais-log-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Terje Sannum
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|