fluent-plugin-nais 0.4.1 → 0.4.2

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: 2c85c792522daf8accb958d554993e69f07eb3fa
4
- data.tar.gz: 03b923b8d36626915a92ed95c9a4b699368ff348
3
+ metadata.gz: f425cdac537c950a9682ecccb1810947b63c1988
4
+ data.tar.gz: dc7d0a3989a4deed1f36e8c78c32c1fec1fe0ae8
5
5
  SHA512:
6
- metadata.gz: c0510b12d30fc832178bedee7b4faa781dc44503d6a51ea53aa259d045761620b0f6ebff2bd499c0393f303ab9e6a3cb346497a18423c702ed9ec321ba6f4f5d
7
- data.tar.gz: ad1e5b980be8889625f712c2ae0229e312b636f8b6af259e765902ca9af23f51a9e0097b5ded43e62850fa318d6e7f59fe28c887e1bd95812deae663321df6d8
6
+ metadata.gz: 1912bbe15d0a5b03d706b967125781349b842ac99ea38e3c3cc38bdc14a8f27bf5714d9f98abe8cd0a532f8affb0d145cce86fa1c56566abb97e740e384eff5b
7
+ data.tar.gz: 9f318090fd16e45db1e84ed7bae2d95a71f3e4bc98b2ea95dda8641b6e91a88a1580237535cc5a233ae371275d3687cb735fca6fe3075751ef620f563578158a
@@ -11,22 +11,24 @@ module Fluent::Plugin
11
11
  end
12
12
 
13
13
  def filter(tag, time, record)
14
- fmt = record['kubernetes']['annotations']['nais_io/logformat']
15
14
  r = nil
16
- if fmt == 'accesslog'
17
- r = ::Nais::Log::Parser.parse_accesslog(record['log'])
18
- unless r.nil?
19
- r = r[0]
20
- r['log'] = r.delete('request')
21
- end
22
- elsif fmt == 'accesslog_with_processing_time'
23
- r = ::Nais::Log::Parser.parse_accesslog_with_processing_time(record['log'])
24
- r['log'] = r.delete('request') unless r.nil?
25
- elsif fmt == 'glog'
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')
15
+ if record['kubernetes'].is_a?(Hash) && record['kubernetes']['annotations'].is_a?(Hash)
16
+ fmt = record['kubernetes']['annotations']['nais_io/logformat']
17
+ if fmt == 'accesslog'
18
+ r = ::Nais::Log::Parser.parse_accesslog(record['log'])
19
+ unless r.nil?
20
+ r = r[0]
21
+ r['log'] = r.delete('request')
22
+ end
23
+ elsif fmt == 'accesslog_with_processing_time'
24
+ r = ::Nais::Log::Parser.parse_accesslog_with_processing_time(record['log'])
25
+ r['log'] = r.delete('request') unless r.nil?
26
+ elsif fmt == 'glog'
27
+ r = ::Nais::Log::Parser.parse_glog(record['log'])
28
+ unless r.nil?
29
+ r['component'] = r.delete('file')+':'+r.delete('line')
30
+ r['log'] = r.delete('message')
31
+ end
30
32
  end
31
33
  end
32
34
  if r.nil?
@@ -1,7 +1,7 @@
1
1
  module Fluent
2
2
  module Plugin
3
3
  module Nais
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
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.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Terje Sannum