fluent-plugin-sumologic_output 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +1 -0
- data/fluent-plugin-sumologic_output.gemspec +1 -1
- data/lib/fluent/plugin/out_sumologic.rb +8 -4
- data/test/plugin/test_out_sumologic.rb +3 -1
- 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: ee7eb500042638028434c901c3c3e652de4d35f4ba1c8cb761cbfcdb4389b3e8
|
4
|
+
data.tar.gz: 73f39ef5c7b68b87ef9f905112db5f0b5d486e22949805d434a642ea4e705be9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efc15f8cbcfb7dd359aade9136acb15fcd517e5ca1c337cf20a9b6d9eb62b0aad24ffc042abfc7ad45563704f83958e51d004520115abef758ef03bd08ee6fc7
|
7
|
+
data.tar.gz: 0dba800ca871ae625e56ea69133bcd7ec937f15ba2f685cd1a5dc2699d082565d9319796b507d4dc09612bcca0d8bc4caf3969f57ecf1df8ce34100c01210134
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -38,6 +38,7 @@ Configuration options for fluent.conf are:
|
|
38
38
|
* `add_timestamp` - Add `timestamp` field to logs before sending to sumologic (default `true`)
|
39
39
|
* `proxy_uri` - Add the `uri` of the `proxy` environment if present.
|
40
40
|
* `metric_data_format` - The format of metrics you will be sending, either `graphite` or `carbon2` (Default is `graphite `)
|
41
|
+
* `disable_cookies` - Option to disable cookies on the HTTP Client. (Default is `false `)
|
41
42
|
|
42
43
|
### Example Configuration
|
43
44
|
Reading from the JSON formatted log files with `in_tail` and wildcard filenames:
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "fluent-plugin-sumologic_output"
|
7
|
-
gem.version = "1.
|
7
|
+
gem.version = "1.3.0"
|
8
8
|
gem.authors = ["Steven Adams", "Frank Reno"]
|
9
9
|
gem.email = ["stevezau@gmail.com", "frank.reno@me.com"]
|
10
10
|
gem.description = %q{Output plugin to SumoLogic HTTP Endpoint}
|
@@ -7,9 +7,9 @@ class SumologicConnection
|
|
7
7
|
|
8
8
|
attr_reader :http
|
9
9
|
|
10
|
-
def initialize(endpoint, verify_ssl, connect_timeout, proxy_uri)
|
10
|
+
def initialize(endpoint, verify_ssl, connect_timeout, proxy_uri, disable_cookies)
|
11
11
|
@endpoint = endpoint
|
12
|
-
create_http_client(verify_ssl, connect_timeout, proxy_uri)
|
12
|
+
create_http_client(verify_ssl, connect_timeout, proxy_uri, disable_cookies)
|
13
13
|
end
|
14
14
|
|
15
15
|
def publish(raw_data, source_host=nil, source_category=nil, source_name=nil, data_type, metric_data_type)
|
@@ -43,10 +43,13 @@ class SumologicConnection
|
|
43
43
|
verify_ssl ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
|
44
44
|
end
|
45
45
|
|
46
|
-
def create_http_client(verify_ssl, connect_timeout, proxy_uri)
|
46
|
+
def create_http_client(verify_ssl, connect_timeout, proxy_uri, disable_cookies)
|
47
47
|
@http = HTTPClient.new(proxy_uri)
|
48
48
|
@http.ssl_config.verify_mode = ssl_options(verify_ssl)
|
49
49
|
@http.connect_timeout = connect_timeout
|
50
|
+
if disable_cookies
|
51
|
+
@http.cookie_manager = nil
|
52
|
+
end
|
50
53
|
end
|
51
54
|
end
|
52
55
|
|
@@ -78,6 +81,7 @@ class Fluent::Plugin::Sumologic < Fluent::Plugin::Output
|
|
78
81
|
config_param :open_timeout, :integer, :default => 60
|
79
82
|
config_param :add_timestamp, :bool, :default => true
|
80
83
|
config_param :proxy_uri, :string, :default => nil
|
84
|
+
config_param :disable_cookies, :bool, :default => false
|
81
85
|
|
82
86
|
config_section :buffer do
|
83
87
|
config_set_default :@type, DEFAULT_BUFFER_TYPE
|
@@ -121,7 +125,7 @@ class Fluent::Plugin::Sumologic < Fluent::Plugin::Output
|
|
121
125
|
end
|
122
126
|
end
|
123
127
|
|
124
|
-
@sumo_conn = SumologicConnection.new(conf['endpoint'], conf['verify_ssl'], conf['open_timeout'].to_i, conf['proxy_uri'])
|
128
|
+
@sumo_conn = SumologicConnection.new(conf['endpoint'], conf['verify_ssl'], conf['open_timeout'].to_i, conf['proxy_uri'], conf['disable_cookies'])
|
125
129
|
super
|
126
130
|
end
|
127
131
|
|
@@ -70,6 +70,7 @@ class SumologicOutput < Test::Unit::TestCase
|
|
70
70
|
assert_equal instance.open_timeout, 60
|
71
71
|
assert_equal instance.add_timestamp, true
|
72
72
|
assert_equal instance.proxy_uri, nil
|
73
|
+
assert_equal instance.disable_cookies, false
|
73
74
|
end
|
74
75
|
|
75
76
|
def test_emit_text
|
@@ -185,6 +186,7 @@ class SumologicOutput < Test::Unit::TestCase
|
|
185
186
|
driver = create_driver(config)
|
186
187
|
time = event_time
|
187
188
|
stub_request(:post, 'https://collectors.sumologic.com/v1/receivers/http/1234')
|
189
|
+
ENV['HOST'] = "foo"
|
188
190
|
driver.run do
|
189
191
|
driver.feed("output.test", time, {'foo' => 'bar', 'message' => 'test', '_sumo_metadata' => {
|
190
192
|
"host": "#{ENV['HOST']}",
|
@@ -193,7 +195,7 @@ class SumologicOutput < Test::Unit::TestCase
|
|
193
195
|
}})
|
194
196
|
end
|
195
197
|
assert_requested :post, "https://collectors.sumologic.com/v1/receivers/http/1234",
|
196
|
-
headers: {'X-Sumo-Category'=>'test', 'X-Sumo-Client'=>'fluentd-output', 'X-Sumo-Host'=>'', 'X-Sumo-Name'=>'output.test'},
|
198
|
+
headers: {'X-Sumo-Category'=>'test', 'X-Sumo-Client'=>'fluentd-output', 'X-Sumo-Host'=>'foo', 'X-Sumo-Name'=>'output.test'},
|
197
199
|
body: /\A{"timestamp":\d+.,"foo":"bar","message":"test"}\z/,
|
198
200
|
times:1
|
199
201
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-sumologic_output
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Adams
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-08-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|