fluent-plugin-barito 0.3.4 → 0.3.5

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
  SHA256:
3
- metadata.gz: d0f25154041dae070b6c1364f5e3aeb3c5e35600bc4c081a40f44d77931ce11c
4
- data.tar.gz: 7f9a411aab36e32e4fa0aafeb70b705d9a15b9dc057c5d6af9b141b8e368b85a
3
+ metadata.gz: 9e4c37eded53d571e098bfbe5b12df7d823711e420229facc6215bfa06f86386
4
+ data.tar.gz: dc1960dd6c13a8dfb765d8b5ae5275d285e225cc3c02e2ab3ea9e248d805d314
5
5
  SHA512:
6
- metadata.gz: b7084b5fa8bea9b83bd50c92f0ed1d81997b9022e1b668fe9f1ea3744465db95b81f19ecfea3b2a275eb1998754e3b1f7bd594cc60dd821ef0e1b6296500a26f
7
- data.tar.gz: eb48ad96d581673acea52f75e1bcf66221918b9841fee8ce062cd5eaa5e0c953ae4bcb386e0c50b71bf3106c83d9f6530c64ba409cde38a82eb8ac1b0fd402a6
6
+ metadata.gz: 88db76d4b14e5eab54266cb19a8c217bf9ca704bdca9030aa4f5d151ad2c1ed288875caec7518a197375b2906c201d81b57149f0160c1587fe42de67daf684bf
7
+ data.tar.gz: 4ceb45b8e712e9d27c929ae2eaa139bc10ef334879aadcaa438ac692b4d157cd7f6c75c659f03468312ea541a80f7451641f58f41cb4cfac40cd5de342358fbc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ **0.3.5**
4
+
5
+ - Add gzip/compressed feature before sent timber
6
+
3
7
  **0.3.4**
4
8
 
5
9
  - Add cluster name field (from k8s)
@@ -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.3.4"
6
+ spec.version = "0.3.5"
7
7
  spec.authors = ["BaritoLog"]
8
8
  spec.email = ["pushm0v.development@gmail.com", "iman.tung@gmail.com"]
9
9
 
@@ -1,4 +1,5 @@
1
1
  require 'rest-client'
2
+ require 'zlib'
2
3
 
3
4
  class Fluent::Plugin::BaritoTransport
4
5
 
@@ -17,4 +18,16 @@ class Fluent::Plugin::BaritoTransport
17
18
  end
18
19
  end
19
20
 
21
+ def send_compressed(timber, header)
22
+ begin
23
+ header['Content-Encoding'] = 'gzip'
24
+
25
+ gz = Zlib::GzipWriter.new(StringIO.new)
26
+ gz << timber.to_json
27
+ RestClient.post @produce_url, gz.close.string, header
28
+ rescue Exception => e
29
+ puts(header)
30
+ @logger.error [e.message, e.response, Hash[header.collect{|k,v| [k.to_s, v]}]].join(', ')
31
+ end
32
+ end
20
33
  end
@@ -66,7 +66,7 @@ module Fluent
66
66
  header = {content_type: :json, 'X-App-Secret' => @application_secret}
67
67
  end
68
68
 
69
- transport.send(data, header)
69
+ transport.send_compressed(data, header)
70
70
  end
71
71
 
72
72
  def clean_attribute(record)
@@ -49,7 +49,7 @@ module Fluent
49
49
  header = {content_type: :json, 'X-App-Secret' => @application_secret}
50
50
  end
51
51
 
52
- transport.send(data, header)
52
+ transport.send_compressed(data, header)
53
53
  end
54
54
  end
55
55
  end
@@ -42,7 +42,7 @@ module Fluent
42
42
  else
43
43
  header = {content_type: :json, 'X-App-Secret' => @application_secret}
44
44
  end
45
- transport.send(timber, header)
45
+ transport.send_compressed(timber, header)
46
46
  end
47
47
  end
48
48
  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.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - BaritoLog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-09 00:00:00.000000000 Z
11
+ date: 2023-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  - !ruby/object:Gem::Version
206
206
  version: '0'
207
207
  requirements: []
208
- rubygems_version: 3.0.3
208
+ rubygems_version: 3.0.3.1
209
209
  signing_key:
210
210
  specification_version: 4
211
211
  summary: Fluentd output plugin for BaritoLog