fluent-plugin-lm-logs 0.0.11 → 0.0.12

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: 6276c2b29bf9e0e047c0d5e33e4d43f0d5f8a2785e4f1764fc5a566ec55e6475
4
- data.tar.gz: 789092f384d3f1e3ff818a0120210c7609becedb88de2b3510cef8722e1caf60
3
+ metadata.gz: c930b2614b184eeba146418a22a10d732b8fd7aa57aabc8db45ec6d9e8608f0a
4
+ data.tar.gz: 6ced74d3ff2e35a3771b63d7f88572c2ebfd4e3dccd23e7a450a5bce6b7a22f7
5
5
  SHA512:
6
- metadata.gz: 1bbcc6d9f3b039bf18cfc9ac973da30b9d427dd3b2ee8a58dea600d5ad5f87f27d9e8f72495539ed7a80c4596fa6c5eceffb6772583c19531ade8e55045b38d7
7
- data.tar.gz: ea7ad55a4d5bd8e2e5f944f23f0d1474dbbda9e8782460c43e66fda28bcdc098dfe02237e7fbd02b109813ebfd6997839cd5b0a8cfaed6d14070834221db12ca
6
+ metadata.gz: dd6ecf139c62cfba239000b45f134bd5c162ea773112438223fcbc20291ddaf97aebc3dec7aca2469639160f585baa2af628b94d445cee01dcb10d5bea7ffc31
7
+ data.tar.gz: e4e97f690c535f223b8c934bcdcf03cf3821f799f6018520ea8c2400eeb726b75de98d7eefa52ab80abf679ec85cc8941123596275f964755b4751372ffc1daf
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "fluent-plugin-lm-logs"
8
- spec.version = '0.0.11'
8
+ spec.version = '0.0.12'
9
9
  spec.authors = ["LogicMonitor"]
10
10
  spec.email = "rubygems@logicmonitor.com"
11
11
  spec.summary = "LogicMonitor logs fluentd output plugin"
@@ -8,6 +8,7 @@ require 'openssl'
8
8
  require 'base64'
9
9
  require 'net/http'
10
10
  require 'net/https'
11
+ require('zlib')
11
12
 
12
13
 
13
14
  module Fluent
@@ -28,6 +29,8 @@ module Fluent
28
29
 
29
30
  config_param :force_encoding, :string, :default => ""
30
31
 
32
+ config_param :compression, :string, :default => ""
33
+
31
34
  # This method is called before starting.
32
35
  # 'conf' is a Hash that includes configuration parameters.
33
36
  # If the configuration is invalid, raise Fluent::ConfigError.
@@ -116,8 +119,16 @@ module Fluent
116
119
 
117
120
  request = Net::HTTP::Post.new(uri.request_uri)
118
121
  request['authorization'] = generate_token(events)
119
- request['Content-type'] = "application/json"
120
- request.body = body
122
+ request['Content-type'] = "application/json"
123
+
124
+ if @compression == "gzip"
125
+ request['Content-Encoding'] = "gzip"
126
+ gzip = Zlib::GzipWriter.new(StringIO.new)
127
+ gzip << body
128
+ request.body = gzip.close.string
129
+ else
130
+ request.body = body
131
+ end
121
132
 
122
133
  resp = http.request(request)
123
134
  if @debug || (!resp.kind_of? Net::HTTPSuccess)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-lm-logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - LogicMonitor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-05 00:00:00.000000000 Z
11
+ date: 2020-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd