fluent-plugin-wodby 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-wodby.gemspec +1 -1
- data/lib/fluent/plugin/filter_wodby.rb +5 -0
- data/test/plugin/test_filter_wodby.rb +6 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45c8c562d96d1ccf43a9ec81aa7771ac8fd05ed071282119c62581ae4d45f5db
|
4
|
+
data.tar.gz: 43e377e23fe30e3af5df48ee6f3c144278339b3c5c18d662705e09ee9e50ce2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1f702cfa38258a6a4cacafbe33d94e4fd9dc3bac2334b8ca7eff3ce5f7e1a9622a76533019f1f69b5da8b2abba8a7e33c2912a9963c8eb399467217dc367eee
|
7
|
+
data.tar.gz: 2b42ea373f5daebc31f7fac557d6d45f9939bc93ceb0dd8c3e0e50e127aa17431345a80639d9b07719d1f88c59045fa01d1958f7a8649f63d18b206ff50ce98e
|
data/fluent-plugin-wodby.gemspec
CHANGED
@@ -36,6 +36,11 @@ module Fluent
|
|
36
36
|
'filter' => true
|
37
37
|
}
|
38
38
|
|
39
|
+
if record.has_key?('wodby.node_name')
|
40
|
+
record['wodby']['node_name'] = record['wodby.node_name']
|
41
|
+
record.delete('wodby.node_name')
|
42
|
+
end
|
43
|
+
|
39
44
|
if record.has_key?('kubernetes') && record['kubernetes'].has_key?('namespace_name')
|
40
45
|
namespace = record['kubernetes']['namespace_name']
|
41
46
|
unless @instance_map.has_key?(namespace)
|
@@ -16,9 +16,9 @@ class WodbyFilterTest < Test::Unit::TestCase
|
|
16
16
|
d = create_driver("api_key #{ENV['WODBY_API_KEY']}")
|
17
17
|
time = event_time
|
18
18
|
d.run do
|
19
|
-
d.feed('filter.test', time, { 'kubernetes' => {'namespace_name' => '650241f4-7303-4668-91c7-b8cd1821d81a'}, 'message' => 'hullo' })
|
20
|
-
d.feed('filter.test', time, { 'kubernetes' => {'namespace_name' => '7ee5d15f-7c3c-4ce8-873e-34b75154f0f4'}, 'message' => 'hullo' })
|
21
|
-
d.feed('filter.test', time, { 'kubernetes' => {'namespace_name' => '650241f4-7303-4668-91c7-b8cd1821d81a'}, 'message' => 'hullo' })
|
19
|
+
d.feed('filter.test', time, { 'kubernetes' => {'namespace_name' => '650241f4-7303-4668-91c7-b8cd1821d81a'}, 'message' => 'hullo', 'wodby.node_name' => 'node' })
|
20
|
+
d.feed('filter.test', time, { 'kubernetes' => {'namespace_name' => '7ee5d15f-7c3c-4ce8-873e-34b75154f0f4'}, 'message' => 'hullo', 'wodby.node_name' => 'node' })
|
21
|
+
d.feed('filter.test', time, { 'kubernetes' => {'namespace_name' => '650241f4-7303-4668-91c7-b8cd1821d81a'}, 'message' => 'hullo', 'wodby.node_name' => 'node' })
|
22
22
|
end
|
23
23
|
|
24
24
|
assert_equal(3, d.filtered_records.size)
|
@@ -27,7 +27,10 @@ class WodbyFilterTest < Test::Unit::TestCase
|
|
27
27
|
assert_equal('dfono.staging', d.filtered_records[2]['wodby']['instance'])
|
28
28
|
assert_equal('dfo.no - Staging', d.filtered_records[0]['wodby']['instance_title'])
|
29
29
|
assert_equal('dfo.no - Prod', d.filtered_records[1]['wodby']['instance_title'])
|
30
|
+
assert_equal('node', d.filtered_records[0]['wodby']['node_name'])
|
31
|
+
assert_equal('node', d.filtered_records[1]['wodby']['node_name'])
|
30
32
|
assert_nil(d.filtered_records[2]['wodby']['instance_query'])
|
33
|
+
assert_nil(d.filtered_records[2]['wodby.node_name'])
|
31
34
|
assert_true(d.filtered_records[0]['wodby']['filter'])
|
32
35
|
assert_true(d.filtered_records[1]['wodby']['filter'])
|
33
36
|
assert_true(d.filtered_records[2]['wodby']['filter'])
|