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 +4 -4
- data/fluent-plugin-lm-logs.gemspec +1 -1
- data/lib/fluent/plugin/out_lm.rb +13 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c930b2614b184eeba146418a22a10d732b8fd7aa57aabc8db45ec6d9e8608f0a
|
4
|
+
data.tar.gz: 6ced74d3ff2e35a3771b63d7f88572c2ebfd4e3dccd23e7a450a5bce6b7a22f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd6ecf139c62cfba239000b45f134bd5c162ea773112438223fcbc20291ddaf97aebc3dec7aca2469639160f585baa2af628b94d445cee01dcb10d5bea7ffc31
|
7
|
+
data.tar.gz: e4e97f690c535f223b8c934bcdcf03cf3821f799f6018520ea8c2400eeb726b75de98d7eefa52ab80abf679ec85cc8941123596275f964755b4751372ffc1daf
|
data/lib/fluent/plugin/out_lm.rb
CHANGED
@@ -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
|
-
|
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.
|
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-
|
11
|
+
date: 2020-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|