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 +4 -4
- data/lib/fluent/plugin/filter_nais_kubewatch.rb +50 -0
- data/lib/fluent/plugin/nais/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4178a0dd14684905d5b3645dc966bd52b6429182
|
4
|
+
data.tar.gz: c37ddf1616ff948ce78061112f9535e3a10361c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
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.
|
130
|
+
rubygems_version: 2.6.14
|
130
131
|
signing_key:
|
131
132
|
specification_version: 4
|
132
133
|
summary: Fluentd plugin for Nais
|