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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d878428a8c1b603fba4aadc59b961a27ebc5b1f7
4
- data.tar.gz: 41c0a845f686a899bf31ff0e5f4d86c3245e76fe
3
+ metadata.gz: b83a347aff499ef4708f4f41c142382f0e8da847
4
+ data.tar.gz: 1fc518ce15015f3626060fd4e62c3a3218a8cffe
5
5
  SHA512:
6
- metadata.gz: 2635639cfb6d71839d166de81f188a7483e147886e49bc2ce46f9853f1d5eacd8f8a3eee11d54510d7b0ba782c8893050c370be84cf19b6699221f884945d790
7
- data.tar.gz: 847d6f34201203868e1f6f90acb74e342251639a037335c94bd0883b67cdae1ad1898383fc62897fb51e65f13a128461fc61275f96de8fe8b4d9935a04243bed
6
+ metadata.gz: d991a45c39de1751d27bd18a544b53d72b79794ea20c560b373615a02000ef4c94aaf511c53c36d436c6ed088c8e4ec546c23e35047a642ec32eb40d03d023d1
7
+ data.tar.gz: e9ba93174d6c27b2cbece3c9b0a4f102d1a9a54f2bb8afe008caefe55ebb5c6190cf5f9ac476074b030a2298c17d334956a08dbff2c017c61ee4e6fdbe3cc24c
@@ -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(log)
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['request_id'] = m[3] unless m[3] == '-'
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
- if m = log.match(/^(\d{4}\/\d\d\/\d\d \d\d:\d\d:\d\d) /)
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
@@ -1,7 +1,7 @@
1
1
  module Nais
2
2
  module Log
3
3
  module Parser
4
- VERSION = "0.13.2"
4
+ VERSION = "0.14.0"
5
5
  end
6
6
  end
7
7
  end
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.13.2
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-05 00:00:00.000000000 Z
11
+ date: 2017-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler