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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bf59c9a932eafcdddedacf0d53fa8fc94deeaa9
4
- data.tar.gz: 9d7706486ca90c5f8976468ef9b56767bba64216
3
+ metadata.gz: c882604f671576bebe8714802423043a5277a141
4
+ data.tar.gz: 53e1a90d87d66b51e8210281e587206a8a0f477e
5
5
  SHA512:
6
- metadata.gz: 82a1a2dffe4c4df5c9e8d5d2f8d564d87a1d1019f3d198e9a5cd099cc059328b982c1b4d34efa7ef2d9bad78a72809b94225be838dc7a1468184ad48699d8bb3
7
- data.tar.gz: e6336b29ae10e9a62d29ed85e7a5a67d133914cb5b64e63ce3e27cb14df7b103644cc3f9be216cd773da1f0f6836e116d97aaf7bb8c1c5c9ef72f86a5b3cfa2d
6
+ metadata.gz: d1c1ab1e4e6d3827076078916bd5d729b5fd10f56f7ec8164ac2a328bfad74436070319b6558e322bdcdf9c1541c2522ef835a40421050e210d26132c7efe111
7
+ data.tar.gz: 76e8501a5e6e8d30e19d14c10bd83ab4e2cd1b89dbff8826e21ab7b2acdd164eb66c97221e05c704250158b31eb576f23cb831e7243974e837245bba30bb824f
@@ -1,7 +1,7 @@
1
1
  module Nais
2
2
  module Log
3
3
  module Parser
4
- VERSION = "0.27.0"
4
+ VERSION = "0.28.0"
5
5
  end
6
6
  end
7
7
  end
@@ -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.27.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-06-14 00:00:00.000000000 Z
11
+ date: 2018-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logfmt