fluent-plugin-barito 0.1.3 → 0.1.4

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: b38f6dce221bcac4d5bd5065345dfd6f424fb1e3
4
- data.tar.gz: 8e3b503c8e7d6780becbe81f46c8cbff267d6057
3
+ metadata.gz: 2792af35a307f76fa10fa2c88468cfafc36c089d
4
+ data.tar.gz: a0f36fe8a09d68e923060ea04bea248b4dfd9cbe
5
5
  SHA512:
6
- metadata.gz: bc03623e27ee2b8e7466f23a41d52f60c2ad4ac630c3e30632a098b18866737268860a46b53ae73912de846ab29e98427d06909a3ef669bcbba7ace0b15bc71f
7
- data.tar.gz: 50f57a05539f4970b8a454268e526d2a54bdf755a16c876632f59572b06130f60a575f26642238258a4ecba72ccff40e52e5893a7e1c4273bb5ceae2e9275e87
6
+ metadata.gz: 9b2b40c21153642979d4fd92b9d99602f524a10158fe23013680800748cd01566f2c34faef0d78c151ce1925f3a7b649d90b5d0822e8a8077f1fadc88fecd6ae
7
+ data.tar.gz: e9e29ece8edc7b26d3991ea66690e2a029f5750e54bf3e96ac25fcf0a553d51794b3fb231ee5090a6bdd16cce19ac913bfefc18d51d20211bfda5c44464f3604
@@ -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.3"
6
+ spec.version = "0.1.4"
7
7
  spec.authors = ["BaritoLog"]
8
8
  spec.email = [""]
9
9
 
@@ -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.3
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-19 00:00:00.000000000 Z
11
+ date: 2018-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler