nais-log-parser 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/nais/log/parser.rb +5 -5
- 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: a18d5e7b70d966fa129a0e82f7478e0c0c3c31dc
|
4
|
+
data.tar.gz: 0f2f9df2634708b1d7cc655217187fd390f9164f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b03948e361406ec475863826b01aaef49939512ce2930b01f265decd75ebbe2c1387bcd30b630b1ec6cf971684eecf17e862250a06451fc9dca5bb5ad5f5cdff
|
7
|
+
data.tar.gz: 5138d0f8abd353a0206d43d4fb016be3befe888cacbdf93e89a9d796e6f2ffe5381c7714cc1886c600f542ee318086a1a6f1a23e3773b45da4e58589bf3e2f7d
|
data/lib/nais/log/parser.rb
CHANGED
@@ -129,7 +129,7 @@ module Nais
|
|
129
129
|
|
130
130
|
def Parser.parse_kv(str)
|
131
131
|
r = {}
|
132
|
-
if match = str.scan(/\b([A-Za-z]{1,20})=(?:([^\ "][^, ]*)|\"([^\"]+)\"),?/)
|
132
|
+
if !str.nil? && match = str.scan(/\b([A-Za-z]{1,20})=(?:([^\ "][^, ]*)|\"([^\"]+)\"),?/)
|
133
133
|
match.each{|m|
|
134
134
|
r[m[0]] = m[1].nil? ? m[2] : m[1]
|
135
135
|
}
|
@@ -138,7 +138,7 @@ module Nais
|
|
138
138
|
end
|
139
139
|
|
140
140
|
def Parser.parse_accesslog(str)
|
141
|
-
if m = str.match(/^(\S+) +(?:(\S+) )?(\S+) \[([^\]]+)\] \"([^\"]*)\" (\S+) (\S+)(.*)/)
|
141
|
+
if !str.nil? && m = str.match(/^(\S+) +(?:(\S+) )?(\S+) \[([^\]]+)\] \"([^\"]*)\" (\S+) (\S+)(.*)/)
|
142
142
|
r = {}
|
143
143
|
r['remote_ip'] = m[1]
|
144
144
|
r['ident'] = m[2] unless (m[2].nil? || m[2] == '-')
|
@@ -190,7 +190,7 @@ module Nais
|
|
190
190
|
end
|
191
191
|
|
192
192
|
def Parser.parse_glog(str)
|
193
|
-
if m = str.match(/^([IWEF])(\d{4} \d\d:\d\d:\d\d\.\d{6})\s+(\S+)\s([^:]+):(\d+)\]\s+(.*)/)
|
193
|
+
if !str.nil? && m = str.match(/^([IWEF])(\d{4} \d\d:\d\d:\d\d\.\d{6})\s+(\S+)\s([^:]+):(\d+)\]\s+(.*)/)
|
194
194
|
r = {}
|
195
195
|
r['level'] = case m[1]
|
196
196
|
when 'I'
|
@@ -215,7 +215,7 @@ module Nais
|
|
215
215
|
|
216
216
|
# https://github.com/coreos/pkg/tree/master/capnslog
|
217
217
|
def Parser.parse_capnslog(str)
|
218
|
-
if m = str.match(/^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d{6}) ([TDNIWEC]) \| ([^:]+):\s*(.*)/)
|
218
|
+
if !str.nil? && m = str.match(/^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d{6}) ([TDNIWEC]) \| ([^:]+):\s*(.*)/)
|
219
219
|
r = {}
|
220
220
|
r['timestamp'] = Time.strptime(m[1], "%Y-%m-%d %H:%M:%S.%N").iso8601(9)
|
221
221
|
r['level'] = case m[2]
|
@@ -243,7 +243,7 @@ module Nais
|
|
243
243
|
end
|
244
244
|
|
245
245
|
def Parser.parse_influxdb(str)
|
246
|
-
if m = str.match(/^\[([^\]]+)\] (.*)$/)
|
246
|
+
if !str.nil? && m = str.match(/^\[([^\]]+)\] (.*)$/)
|
247
247
|
r = {}
|
248
248
|
comp = m[1]
|
249
249
|
msg = m[2]
|
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.25.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: 2018-
|
11
|
+
date: 2018-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logfmt
|