fluent-plugin-nais 0.4.0 → 0.4.1

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: 77053c2957a21b76e805fc9f4e0b9c9755e34487
4
- data.tar.gz: eaeea01eefbbb7c3dcb1406d1146beedd324cd1a
3
+ metadata.gz: 2c85c792522daf8accb958d554993e69f07eb3fa
4
+ data.tar.gz: 03b923b8d36626915a92ed95c9a4b699368ff348
5
5
  SHA512:
6
- metadata.gz: dc1ab36c46e28df9e150499c00f780ff0f6a7e9b7cd7b1c73e317324063a202a51d4f5ca83028cf90a5f619c8be94e515f175074037f4400b4aed68754fb3862
7
- data.tar.gz: dbc68c5a1ee3509ead105f19358a4d7016d0ab71296edb44655e4c4b6be7f37cab44012d93122bc9efeb1639e91521d9ed274486a9e2afe60d3a8b9a50d0eadf
6
+ metadata.gz: c0510b12d30fc832178bedee7b4faa781dc44503d6a51ea53aa259d045761620b0f6ebff2bd499c0393f303ab9e6a3cb346497a18423c702ed9ec321ba6f4f5d
7
+ data.tar.gz: ad1e5b980be8889625f712c2ae0229e312b636f8b6af259e765902ca9af23f51a9e0097b5ded43e62850fa318d6e7f59fe28c887e1bd95812deae663321df6d8
@@ -11,15 +11,23 @@ module Fluent::Plugin
11
11
  end
12
12
 
13
13
  def filter(tag, time, record)
14
- fmt = record['kubernetes']['annotations']['nais.io/logformat']
14
+ fmt = record['kubernetes']['annotations']['nais_io/logformat']
15
15
  r = nil
16
16
  if fmt == 'accesslog'
17
17
  r = ::Nais::Log::Parser.parse_accesslog(record['log'])
18
- r = r[0] unless r.nil?
18
+ unless r.nil?
19
+ r = r[0]
20
+ r['log'] = r.delete('request')
21
+ end
19
22
  elsif fmt == 'accesslog_with_processing_time'
20
23
  r = ::Nais::Log::Parser.parse_accesslog_with_processing_time(record['log'])
24
+ r['log'] = r.delete('request') unless r.nil?
21
25
  elsif fmt == 'glog'
22
26
  r = ::Nais::Log::Parser.parse_glog(record['log'])
27
+ unless r.nil?
28
+ r['component'] = r.delete('file')+':'+r.delete('line')
29
+ r['log'] = r.delete('message')
30
+ end
23
31
  end
24
32
  if r.nil?
25
33
  record
@@ -1,7 +1,7 @@
1
1
  module Fluent
2
2
  module Plugin
3
3
  module Nais
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-nais
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Terje Sannum