fluent-plugin-nais 0.13.0 → 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: 3fd583ee36851eed7cff7c1fa57e2a53b952e79b
4
- data.tar.gz: 75c137520087b99217ca9bedf9536badcc687783
3
+ metadata.gz: 4178a0dd14684905d5b3645dc966bd52b6429182
4
+ data.tar.gz: c37ddf1616ff948ce78061112f9535e3a10361c6
5
5
  SHA512:
6
- metadata.gz: 3415cfa059e9029527703f694be9445344c368f52b022ad8e9a3117a1100545e6bc40d90b774e6169926282db6664cffb6caabb942b626e0be1380011d9f121b
7
- data.tar.gz: 6038346aa04e421b6ff0f579fba3ff58b32e00542594fb15d8ac25b515935dea39afaffac57cedfce6351b9359a60fd48b76b2c43b730335deecd021ac0be741
6
+ metadata.gz: e317c6aee959b77675390212a0505798bb5d088521daffc437def32d73be4308c38095f6b5e5fb037b6d23958fc9cd3196a4e71411cc6e4e9cc294de50a7bacd
7
+ data.tar.gz: ce0161852d2338d37087fc2ce2fb303e543b8f47ed1877e9d34be0a533cd05af818c2ecec3b5b72d6ca1c04fdaa64961bdf7740b938bfb77fd04a023d104fa98
@@ -0,0 +1,50 @@
1
+ require "fluent/plugin/nais/version"
2
+ require 'fluent/plugin/filter'
3
+
4
+ module Fluent
5
+ module Plugin
6
+ class NaisKubewatchFilter < Fluent::Plugin::Filter
7
+ Fluent::Plugin.register_filter('nais_kubewatch', self)
8
+
9
+ def filter(tag, time, record)
10
+ if record['source'].is_a?(Hash)
11
+ if record['source'].has_key?('host')
12
+ record['host'] = record['source']['host']
13
+ end
14
+ if record['source'].has_key?('component')
15
+ record['source'] = record['source']['component']
16
+ end
17
+ end
18
+ record['event'] = record.delete('reason') if record.has_key?('reason')
19
+ type = record.delete('type')
20
+ if type == 'Normal'
21
+ record['level'] = 'Info'
22
+ elsif !type.nil?
23
+ record['level'] = type
24
+ end
25
+ if record.has_key?('involvedObject')
26
+ if record['involvedObject']['kind'] == 'Pod'
27
+ if record['involvedObject']['fieldPath'] =~ /^spec.containers\{([^\}]+)\}$/
28
+ record['application'] = $1
29
+ record['pod'] = record['involvedObject']['name']
30
+ record['namespace'] = record['involvedObject']['namespace']
31
+ record.delete('involvedObject')
32
+ record.delete('container')
33
+ end
34
+ end
35
+ if record.has_key?('involvedObject')
36
+ record['involvedObject'].delete('uid')
37
+ record['involvedObject'].delete('resourceVersion')
38
+ record['involvedObject'].delete('apiVersion')
39
+ end
40
+ end
41
+ record.delete('count')
42
+ record.delete('firstTimestamp')
43
+ record.delete('lastTimestamp')
44
+ record.delete('metadata')
45
+ record
46
+ end
47
+
48
+ end
49
+ end
50
+ end
@@ -1,7 +1,7 @@
1
1
  module Fluent
2
2
  module Plugin
3
3
  module Nais
4
- VERSION = "0.13.0"
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: fluent-plugin-nais
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
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-11-13 00:00:00.000000000 Z
11
+ date: 2017-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -99,6 +99,7 @@ files:
99
99
  - fluent-plugin-nais.gemspec
100
100
  - lib/fluent/plugin/filter_nais_flatten_record.rb
101
101
  - lib/fluent/plugin/filter_nais_keywords.rb
102
+ - lib/fluent/plugin/filter_nais_kubewatch.rb
102
103
  - lib/fluent/plugin/filter_nais_logformat.rb
103
104
  - lib/fluent/plugin/filter_nais_logtransform.rb
104
105
  - lib/fluent/plugin/filter_nais_prefix_fields.rb
@@ -126,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
127
  version: '0'
127
128
  requirements: []
128
129
  rubyforge_project:
129
- rubygems_version: 2.6.13
130
+ rubygems_version: 2.6.14
130
131
  signing_key:
131
132
  specification_version: 4
132
133
  summary: Fluentd plugin for Nais