fluent-plugin-barito 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/fluent-plugin-barito.gemspec +1 -1
- data/lib/fluent/plugin/out_barito.rb +21 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2792af35a307f76fa10fa2c88468cfafc36c089d
|
|
4
|
+
data.tar.gz: a0f36fe8a09d68e923060ea04bea248b4dfd9cbe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9b2b40c21153642979d4fd92b9d99602f524a10158fe23013680800748cd01566f2c34faef0d78c151ce1925f3a7b649d90b5d0822e8a8077f1fadc88fecd6ae
|
|
7
|
+
data.tar.gz: e9e29ece8edc7b26d3991ea66690e2a029f5750e54bf3e96ac25fcf0a553d51794b3fb231ee5090a6bdd16cce19ac913bfefc18d51d20211bfda5c44464f3604
|
|
@@ -11,7 +11,7 @@ module Fluent
|
|
|
11
11
|
config_param :use_https, :bool, :default => false
|
|
12
12
|
config_param :use_kubernetes, :bool, :default => false
|
|
13
13
|
|
|
14
|
-
config_param :application_secret, :string, :default =>
|
|
14
|
+
config_param :application_secret, :string, :default => nil
|
|
15
15
|
config_param :stream_id, :string, :default => ''
|
|
16
16
|
config_param :store_id, :string, :default => ''
|
|
17
17
|
config_param :client_id, :string, :default => ''
|
|
@@ -19,12 +19,30 @@ module Fluent
|
|
|
19
19
|
config_param :produce_host, :string, :default => ''
|
|
20
20
|
config_param :produce_port, :string, :default => ''
|
|
21
21
|
config_param :produce_topic, :string, :default => ''
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
config_param :barito_market_url, :string, :default => nil
|
|
23
24
|
config_param :produce_url, :string, :default => ''
|
|
24
25
|
|
|
25
26
|
def start
|
|
26
27
|
super
|
|
27
28
|
@protocol = 'http'
|
|
29
|
+
get_config
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def get_config
|
|
33
|
+
@barito_market_url ||= ENV['BARITO_MARKET_URL']
|
|
34
|
+
@application_secret ||= ENV['BARITO_MARKET_APPLICATION_SECRET']
|
|
35
|
+
response = RestClient.get @barito_market_url, {content_type: :json, application_secret: @application_secret}
|
|
36
|
+
body = response.body
|
|
37
|
+
unless body.nil?
|
|
38
|
+
client = JSON.parse(body)
|
|
39
|
+
@produce_url = client["client"]["produce_url"]
|
|
40
|
+
if @produce_url.nil?
|
|
41
|
+
log.error("Produce URL from BaritoMarket is nil")
|
|
42
|
+
else
|
|
43
|
+
log.info("Start with Produce URL : #{@produce_url}")
|
|
44
|
+
end
|
|
45
|
+
end
|
|
28
46
|
end
|
|
29
47
|
|
|
30
48
|
def send_message(url, message)
|
|
@@ -71,7 +89,7 @@ module Fluent
|
|
|
71
89
|
end
|
|
72
90
|
|
|
73
91
|
unless record.has_key?(TIMESTAMP_FIELD)
|
|
74
|
-
t = Time.now
|
|
92
|
+
t = Time.now.utc
|
|
75
93
|
unless time.nil?
|
|
76
94
|
if time.is_a?(Integer)
|
|
77
95
|
t = Time.at(time)
|
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.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- BaritoLog
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-03-
|
|
11
|
+
date: 2018-03-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|