fluent-plugin-barito 0.2.2 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea66818ca2cbcab4339ee69b8e4b7df8196ec94f39fafff1ea79bb17a5d80faa
4
- data.tar.gz: a7fcfe47fbae888db2aa54813730fb77eee806f0e38b7ded56eaaec9c8e3f1d0
3
+ metadata.gz: 1ec068b1185becae1dda2a06e40dcc94fb302324d107569169a5ca28f7099255
4
+ data.tar.gz: 250d92a965897c3df2e97fa6980226c99242b9ff78787a9c5a27194855676ee7
5
5
  SHA512:
6
- metadata.gz: a05219378ff836fd4afc7ee5533c3c3d97dd0ecf8f60f1d6ff383859503aa87e622efaa8dddc1430004ef001584a9fd39938a56bd4c3d0a14b24eb79741bc3f8
7
- data.tar.gz: 5687a35a0b334de920652b2a01b68019d177fcc9cf782fc0aac72933f6f105c6dce873d6c603425d2e69d993fab1bef1faeb05360e51329ae032be2b18038a3d
6
+ metadata.gz: e22e75f60213ff574a9c478ba9ef76d923baf4a3e0a32c061539ee0bfa56bebc73f60546f5d8f460a1bb854e2bc19da5d00746f37514bf49e65b1c91e0b22304
7
+ data.tar.gz: a6ce02ac99154393e7d75dc47ea31f08716950f58c2bf6f7a6aee9e4e19b472df6ccb192144758c41579399e57841d0012e23af7626f35658b1f53d629fadcd3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ **0.3.0**
4
+
5
+ - Handle batch produce (from VM)
6
+
3
7
  **0.2.1**
4
8
 
5
9
  - Change blank? with empty?
@@ -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.2.2"
6
+ spec.version = "0.3.0"
7
7
  spec.authors = ["BaritoLog"]
8
8
  spec.email = ["pushm0v.development@gmail.com", "iman.tung@gmail.com"]
9
9
 
@@ -0,0 +1,54 @@
1
+ require 'fluent/output'
2
+ require 'rest-client'
3
+ require_relative 'barito_timber'
4
+ require_relative 'barito_client_trail'
5
+
6
+ module Fluent
7
+ class BaritoBatchVMOutput < BufferedOutput
8
+
9
+ PLUGIN_NAME = "barito_batch_vm"
10
+
11
+ Fluent::Plugin.register_output(PLUGIN_NAME, self)
12
+
13
+ config_param :application_secret, :string, :default => nil
14
+ config_param :application_group_secret, :string, :default => nil
15
+ config_param :application_name, :string, :default => nil
16
+ config_param :produce_url, :string, :default => ''
17
+
18
+ # Overide from BufferedOutput
19
+ def start
20
+ super
21
+ end
22
+
23
+ # Overide from BufferedOutput
24
+ def format(tag, time, record)
25
+ [tag, time, record].to_msgpack
26
+ end
27
+
28
+ # Overide from BufferedOutput
29
+ def write(chunk)
30
+ data = {
31
+ 'items' => []
32
+ }
33
+ chunk.msgpack_each do |tag, time, record|
34
+ trail = Fluent::Plugin::ClientTrail.new(false)
35
+ timber = Fluent::Plugin::TimberFactory::create_timber(tag, time, record, trail)
36
+
37
+ data['items'] << timber
38
+ end
39
+
40
+ if @application_secret.nil? or @application_secret.empty?
41
+ return if @application_group_secret.nil? or @application_name.nil?
42
+ header = {
43
+ content_type: :json,
44
+ 'X-App-Group-Secret' => @application_group_secret,
45
+ 'X-App-Name' => @application_name
46
+ }
47
+ else
48
+ header = {content_type: :json, 'X-App-Secret' => @application_secret}
49
+ end
50
+
51
+ response = RestClient.post @produce_url, data.to_json, header
52
+ end
53
+ end
54
+ 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.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BaritoLog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-24 00:00:00.000000000 Z
11
+ date: 2018-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -162,6 +162,7 @@ files:
162
162
  - fluent-plugin-barito.gemspec
163
163
  - lib/fluent/plugin/barito_client_trail.rb
164
164
  - lib/fluent/plugin/barito_timber.rb
165
+ - lib/fluent/plugin/out_barito_batch_vm.rb
165
166
  - lib/fluent/plugin/out_barito_k8s.rb
166
167
  - lib/fluent/plugin/out_barito_vm.rb
167
168
  - spec/lib/fluent/plugin/barito_timber_spec.rb
@@ -187,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
188
  version: '0'
188
189
  requirements: []
189
190
  rubyforge_project:
190
- rubygems_version: 2.7.6
191
+ rubygems_version: 2.7.7
191
192
  signing_key:
192
193
  specification_version: 4
193
194
  summary: Fluentd output plugin for BaritoLog