nais-log-parser 0.27.0 → 0.28.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/version.rb +1 -1
- data/lib/nais/log/parser.rb +14 -0
- 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: c882604f671576bebe8714802423043a5277a141
|
4
|
+
data.tar.gz: 53e1a90d87d66b51e8210281e587206a8a0f477e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1c1ab1e4e6d3827076078916bd5d729b5fd10f56f7ec8164ac2a328bfad74436070319b6558e322bdcdf9c1541c2522ef835a40421050e210d26132c7efe111
|
7
|
+
data.tar.gz: 76e8501a5e6e8d30e19d14c10bd83ab4e2cd1b89dbff8826e21ab7b2acdd164eb66c97221e05c704250158b31eb576f23cb831e7243974e837245bba30bb824f
|
data/lib/nais/log/parser.rb
CHANGED
@@ -259,6 +259,20 @@ module Nais
|
|
259
259
|
end
|
260
260
|
end
|
261
261
|
|
262
|
+
def Parser.parse_simple(str)
|
263
|
+
if !str.nil? && m = str.match(/^(\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(?:[,.]\d{3,9})?) ([a-zA-Z]+) (?:\[([^\]]+)\] )?(\S+) (.*)/)
|
264
|
+
r = {}
|
265
|
+
r['timestamp'] = Time.parse(m[1]).gmtime.iso8601(9)
|
266
|
+
r['level'] = m[2]
|
267
|
+
r['thread'] = m[3] if !m[3].nil?
|
268
|
+
r['component'] = m[4]
|
269
|
+
r['message'] = m[5]
|
270
|
+
return r
|
271
|
+
else
|
272
|
+
return nil
|
273
|
+
end
|
274
|
+
end
|
275
|
+
|
262
276
|
# https://github.com/coreos/pkg/tree/master/capnslog
|
263
277
|
def Parser.parse_capnslog(str)
|
264
278
|
if !str.nil? && m = str.match(/^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d{6}) ([TDNIWEC]) \| ([^:]+):\s*(.*)/)
|
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.28.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-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logfmt
|