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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbc3e6090c1c01b886a60cfa29ffc2d378aa1151a2cfeb1e192bf067810d15eb
4
- data.tar.gz: 7a3c9f00aab9018734c01b1df56b4cac7727fe9612796cedd626eb07ab8c8865
3
+ metadata.gz: ee7eb500042638028434c901c3c3e652de4d35f4ba1c8cb761cbfcdb4389b3e8
4
+ data.tar.gz: 73f39ef5c7b68b87ef9f905112db5f0b5d486e22949805d434a642ea4e705be9
5
5
  SHA512:
6
- metadata.gz: 2052a8867e338718c573a5d62760bd700d6fc859933bdd704ed9de85105aaae02082cd4204892ffc17358389d485de8709ccb2583c1b40493401098d3be375f0
7
- data.tar.gz: 0b301be091e054f5c37b29e7913d77f96e61886aa810a49c917df221079b2beaf7c20cb684baa642abd7c83c4c7e6a7ae770d8f0060998f24616873632fa1b10
6
+ metadata.gz: efc15f8cbcfb7dd359aade9136acb15fcd517e5ca1c337cf20a9b6d9eb62b0aad24ffc042abfc7ad45563704f83958e51d004520115abef758ef03bd08ee6fc7
7
+ data.tar.gz: 0dba800ca871ae625e56ea69133bcd7ec937f15ba2f685cd1a5dc2699d082565d9319796b507d4dc09612bcca0d8bc4caf3969f57ecf1df8ce34100c01210134
data/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. Tracking did not begin until version 1.10.
4
4
 
5
+ <a name="1.3.0"></a>
6
+ # [1.3.0] (2018-08-08)
7
+
5
8
  <a name="1.2.0"></a>
6
9
  # [1.2.0] (2018-07-18)
7
10
 
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.2.0"
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.2.0
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-07-18 00:00:00.000000000 Z
12
+ date: 2018-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler