fluent-plugin-barito 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/fluent-plugin-barito.gemspec +2 -2
- data/lib/fluent/plugin/out_barito_k8s.rb +17 -34
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 380a4d3f92566e9da10ce617114c07aca43f7313530efb1c905dec6771ab7e3f
|
4
|
+
data.tar.gz: 7f7db5fc7f2125649d3365154392dd10b2f7af445cb86bdd487cf5e6a730ad47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f14b53f8afb43f140be186f20d1c175e8ab3c914219b6cb11146c0578bd2123ef9ebe13c17360d8de0a76aca1e87362d69428853db357393973cc91c00f66c5e
|
7
|
+
data.tar.gz: 937d8010b022fcd4fe88bdb625649009f03af708bc1ec593d1a103ef84a038b03a5f59c9a08e3d0b45de006dad9c7d35d336915891566aaa16b4bd5af18d5326
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = "fluent-plugin-barito"
|
6
|
-
spec.version = "0.1.
|
6
|
+
spec.version = "0.1.11"
|
7
7
|
spec.authors = ["BaritoLog"]
|
8
8
|
spec.email = ["pushm0v.development@gmail.com", "iman.tung@gmail.com"]
|
9
9
|
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency 'simplecov'
|
28
28
|
spec.add_development_dependency 'coveralls', '~> 0.8.21'
|
29
29
|
spec.add_development_dependency 'test-unit', '~> 3.2'
|
30
|
-
|
30
|
+
|
31
31
|
spec.add_runtime_dependency "fluentd", "~> 0.12", ">= 0.12.0"
|
32
32
|
spec.add_runtime_dependency "rest-client", "~> 2"
|
33
33
|
end
|
@@ -7,17 +7,10 @@ module Fluent
|
|
7
7
|
class BaritoK8sOutput < BufferedOutput
|
8
8
|
|
9
9
|
PLUGIN_NAME = 'barito_k8s'
|
10
|
-
|
11
|
-
|
12
|
-
LABEL_PRODUCE_HOST = 'baritoProduceHost'
|
13
|
-
LABEL_PRODUCE_PORT = 'baritoProducePort'
|
14
|
-
LABEL_PRODUCE_TOPIC = 'baritoProduceTopic'
|
15
|
-
|
10
|
+
LABEL_APP_SECRET = 'barito.applicationSecret'
|
11
|
+
LABEL_PRODUCE_URL = 'barito.produceUrl'
|
16
12
|
|
17
13
|
Fluent::Plugin.register_output(PLUGIN_NAME, self)
|
18
|
-
|
19
|
-
config_param :use_https, :bool, :default => false
|
20
|
-
|
21
14
|
|
22
15
|
# Overide from BufferedOutput
|
23
16
|
def start
|
@@ -31,38 +24,28 @@ module Fluent
|
|
31
24
|
|
32
25
|
# Overide from BufferedOutput
|
33
26
|
def write(chunk)
|
34
|
-
|
35
27
|
chunk.msgpack_each do |tag, time, record|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
28
|
+
params = record['kubernetes']['annotations']
|
29
|
+
|
30
|
+
next if params.nil?
|
31
|
+
url = produce_url(params)
|
32
|
+
secret = application_secret(params)
|
33
|
+
|
34
|
+
next if url.nil? or secret.nil?
|
35
|
+
trail = Fluent::Plugin::ClientTrail.new(false)
|
42
36
|
timber = Fluent::Plugin::TimberFactory::create_timber(tag, time, record, trail)
|
43
37
|
header = {content_type: :json, 'X-App-Secret' => secret}
|
44
|
-
|
38
|
+
|
45
39
|
RestClient.post url, timber.to_json, header
|
46
40
|
end
|
47
41
|
end
|
48
|
-
|
49
|
-
def produce_url(
|
50
|
-
|
51
|
-
produce_port = labels[LABEL_PRODUCE_PORT]
|
52
|
-
produce_topic = labels[LABEL_PRODUCE_TOPIC]
|
53
|
-
|
54
|
-
protocol = @use_https? 'https' : 'http'
|
55
|
-
|
56
|
-
produce_url = "#{protocol}://#{produce_host}:#{produce_port}/produce/#{produce_topic}"
|
57
|
-
produce_url
|
42
|
+
|
43
|
+
def produce_url(params)
|
44
|
+
params[LABEL_PRODUCE_URL]
|
58
45
|
end
|
59
|
-
|
60
|
-
def application_secret(
|
61
|
-
|
46
|
+
|
47
|
+
def application_secret(params)
|
48
|
+
params[LABEL_APP_SECRET]
|
62
49
|
end
|
63
|
-
|
64
|
-
|
65
50
|
end
|
66
|
-
|
67
|
-
|
68
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-barito
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BaritoLog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
186
|
version: '0'
|
187
187
|
requirements: []
|
188
188
|
rubyforge_project:
|
189
|
-
rubygems_version: 2.6
|
189
|
+
rubygems_version: 2.7.6
|
190
190
|
signing_key:
|
191
191
|
specification_version: 4
|
192
192
|
summary: Fluentd output plugin for BaritoLog
|