logstash-output-elasticsearch 6.2.6-java → 6.3.0-java

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
  SHA1:
3
- metadata.gz: 61e3482785093444d19b07aae664a7f4bdd9d8a8
4
- data.tar.gz: 583f5fac5272e56c5aa7f11246d92b2fe521e352
3
+ metadata.gz: c643a65352466edd12cc72fd46dc55cb55b31abe
4
+ data.tar.gz: 4ee86089fd0a20e3ca27ff3434faa31408ed941d
5
5
  SHA512:
6
- metadata.gz: da95653926bd5c8a3e83b06d9cdaa8f0682018338221959e1c42d02000fea0e2bb9c7f9b3de94053a8bee6c4de1fa9354d90eba355e4f6ffdd28dfcc59901755
7
- data.tar.gz: 75fe257a8468a539dbc54e691b8de5f71930e2646107264d664f871d7289a49d745feccc9a465d875bdea7d0786386fc041442de6fc22133662859a05bbe5b85
6
+ metadata.gz: e3c9c26a775b61f24da553bed01dba155bdca35fea9513d13f5ca818ba49f49d2ce779ed53542d20ae3c6aa40814ccb6a1f82b583ff41b65338296d3bd9ec631
7
+ data.tar.gz: 5ab4e49ff1fd3b35d739c4e5e44c4a0e36ffd8ebe563fa9e235b03936e5015fc571171b97c9a610c6d3a7f4e696761ee829114f09d30bada34ffa90dc74eb3dd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 6.3.0
2
+ - Add support for customizing sniffing_path with absolute_sniffing_path
3
+
1
4
  ## 6.2.6
2
5
  - Fixed: Change how the healthcheck_path is treated: either append it to any existing path (default) or replace any existing path
3
6
  Also ensures that the healthcheck url contains no query parameters regarless of hosts urls contains them or query_params being set. #554
@@ -188,6 +188,24 @@ class LogStash::Outputs::ElasticSearch < LogStash::Outputs::Base
188
188
  # * with `absolute_healthcheck_path: false`: "http://localhost:9200/health"
189
189
  config :absolute_healthcheck_path, :validate => :boolean, :default => false
190
190
 
191
+ # If sniffing is enabled, this plugin will periodically execute a request
192
+ # to one of the nodes to retrieve the list of other nodes eligible to receive
193
+ # bulk requests. By default this path is `_nodes/http` but if you need to set
194
+ # it to something else, this is the place
195
+ # NOTE: any query parameters present in the URL or query_params config option will be removed
196
+ config :sniffing_path, :validate => :string, :default => "_nodes/http"
197
+
198
+ # When a `sniffing_path` config is provided, this additional flag can be used to
199
+ # specify whether this sniffing_path is appended to the existing path (default)
200
+ # or is treated as the absolute URL path.
201
+ #
202
+ # For example, if hosts url is "http://localhost:9200/es" and sniffing_path is "/_sniffing",
203
+ # the sniffing request will be sent to:
204
+ #
205
+ # * with `absolute_sniffing_path: true`: "http://localhost:9200/es/_sniffing"
206
+ # * with `absolute_sniffing_path: false`: "http://localhost:9200/_sniffing"
207
+ config :absolute_sniffing_path, :validate => :boolean, :default => false
208
+
191
209
  # How frequently, in seconds, to wait between resurrection attempts.
192
210
  # Resurrection is the process by which backend endpoints marked 'down' are checked
193
211
  # to see if they have come back to life
@@ -251,6 +251,8 @@ module LogStash; module Outputs; class ElasticSearch;
251
251
  :sniffer_delay => options[:sniffer_delay],
252
252
  :healthcheck_path => options[:healthcheck_path],
253
253
  :absolute_healthcheck_path => options[:absolute_healthcheck_path],
254
+ :sniffing_path => options[:sniffing_path],
255
+ :absolute_sniffing_path => options[:absolute_sniffing_path],
254
256
  :resurrect_delay => options[:resurrect_delay],
255
257
  :url_normalizer => self.method(:host_to_url)
256
258
  }
@@ -28,13 +28,15 @@ module LogStash; module Outputs; class ElasticSearch; class HttpClient;
28
28
  end
29
29
  end
30
30
 
31
- attr_reader :logger, :adapter, :sniffing, :sniffer_delay, :resurrect_delay, :healthcheck_path, :absolute_healthcheck_path
31
+ attr_reader :logger, :adapter, :sniffing, :sniffer_delay, :resurrect_delay, :healthcheck_path, :absolute_healthcheck_path, :sniffing_path, :absolute_sniffing_path
32
32
 
33
33
  ROOT_URI_PATH = '/'.freeze
34
34
 
35
35
  DEFAULT_OPTIONS = {
36
36
  :healthcheck_path => ROOT_URI_PATH,
37
37
  :absolute_healthcheck_path => false,
38
+ :sniffing_path => '_nodes/http',
39
+ :absolute_sniffing_path => false,
38
40
  :scheme => 'http',
39
41
  :resurrect_delay => 5,
40
42
  :sniffing => false,
@@ -51,6 +53,8 @@ module LogStash; module Outputs; class ElasticSearch; class HttpClient;
51
53
  DEFAULT_OPTIONS.merge(options).tap do |merged|
52
54
  @healthcheck_path = merged[:healthcheck_path]
53
55
  @absolute_healthcheck_path = merged[:absolute_healthcheck_path]
56
+ @sniffing_path = merged[:sniffing_path]
57
+ @absolute_sniffing_path = merged[:absolute_sniffing_path]
54
58
  @resurrect_delay = merged[:resurrect_delay]
55
59
  @sniffing = merged[:sniffing]
56
60
  @sniffer_delay = merged[:sniffer_delay]
@@ -152,9 +156,17 @@ module LogStash; module Outputs; class ElasticSearch; class HttpClient;
152
156
  ES2_SNIFF_RE_URL = /([^\/]*)?\/?([^:]*):([0-9]+)/
153
157
  # Sniffs and returns the results. Does not update internal URLs!
154
158
  def check_sniff
155
- url, resp = perform_request(:get, '_nodes/http')
159
+ resp = nil
160
+ with_connection do |url|
161
+ sniffing_url = url.clone
162
+ sniffing_url.query = nil
163
+ if @absolute_sniffing_path
164
+ sniffing_url.path = ROOT_URI_PATH
165
+ end
166
+ resp = perform_request_to_url(sniffing_url, :get, @sniffing_path, {}, nil)
167
+ end
156
168
  parsed = LogStash::Json.load(resp.body)
157
-
169
+
158
170
  nodes = parsed['nodes']
159
171
  if !nodes || nodes.empty?
160
172
  @logger.warn("Sniff returned no nodes! Will not update hosts.")
@@ -15,7 +15,9 @@ module LogStash; module Outputs; class ElasticSearch;
15
15
  :client_settings => client_settings,
16
16
  :resurrect_delay => params["resurrect_delay"],
17
17
  :healthcheck_path => params["healthcheck_path"],
18
- :absolute_healthcheck_path => params["absolute_healthcheck_path"]
18
+ :absolute_healthcheck_path => params["absolute_healthcheck_path"],
19
+ :sniffing_path => params["sniffing_path"],
20
+ :absolute_sniffing_path => params["absolute_sniffing_path"]
19
21
  }
20
22
 
21
23
  if params["sniffing"]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-elasticsearch'
3
- s.version = '6.2.6'
3
+ s.version = '6.3.0'
4
4
  s.licenses = ['apache-2.0']
5
5
  s.summary = "Logstash Output to Elasticsearch"
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -102,6 +102,42 @@ describe LogStash::Outputs::ElasticSearch::HttpClient::Pool do
102
102
  expect(subject.sniffer_alive?).to eql(true)
103
103
  end
104
104
  end
105
+ describe "absolute_sniffing_path" do
106
+ let(:initial_urls) { [::LogStash::Util::SafeURI.new("http://localhost:9200#{path}")] }
107
+ let(:path) { "/meh" }
108
+ let(:options) { super.merge(:absolute_sniffing_path => absolute_sniffing_path, :path => path, :sniffing_path => sniffing_path) }
109
+ let(:sniffing_path) { "/some/other/path" }
110
+ let(:absolute_sniffing_path) { false }
111
+ let(:response) { double("manticore_response") }
112
+
113
+ before(:each) { allow(response).to receive(:body).and_return("{}") }
114
+
115
+ context "when enabled" do
116
+ let(:absolute_sniffing_path) { true }
117
+ it "should use the sniffing_path as the absolute path" do
118
+ expect(subject).to receive(:perform_request_to_url) do |url, method, req_path, _, _|
119
+ expect(method).to eq(:get)
120
+ expect(req_path).to eq(sniffing_path)
121
+ expect(url.path).to eq("/")
122
+ response
123
+ end
124
+ subject.check_sniff
125
+ end
126
+ end
127
+
128
+ context "when disabled" do
129
+ let(:absolute_sniffing_path) { false }
130
+ it "should use the sniffing_path as a relative path" do
131
+ expect(subject).to receive(:perform_request_to_url) do |url, method, req_path, _, _|
132
+ expect(method).to eq(:get)
133
+ expect(req_path).to eq(sniffing_path)
134
+ expect(url.path).to eq(path)
135
+ response
136
+ end
137
+ subject.check_sniff
138
+ end
139
+ end
140
+ end
105
141
  end
106
142
 
107
143
  describe "closing" do
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.6
4
+ version: 6.3.0
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-07 00:00:00.000000000 Z
11
+ date: 2017-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- requirement: !ruby/object:Gem::Requirement
14
+ name: stud
15
+ version_requirements: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - ">="
17
18
  - !ruby/object:Gem::Version
@@ -19,10 +20,7 @@ dependencies:
19
20
  - - "~>"
20
21
  - !ruby/object:Gem::Version
21
22
  version: '0.0'
22
- name: stud
23
- prerelease: false
24
- type: :runtime
25
- version_requirements: !ruby/object:Gem::Requirement
23
+ requirement: !ruby/object:Gem::Requirement
26
24
  requirements:
27
25
  - - ">="
28
26
  - !ruby/object:Gem::Version
@@ -30,22 +28,25 @@ dependencies:
30
28
  - - "~>"
31
29
  - !ruby/object:Gem::Version
32
30
  version: '0.0'
31
+ prerelease: false
32
+ type: :runtime
33
33
  - !ruby/object:Gem::Dependency
34
- requirement: !ruby/object:Gem::Requirement
34
+ name: cabin
35
+ version_requirements: !ruby/object:Gem::Requirement
35
36
  requirements:
36
37
  - - "~>"
37
38
  - !ruby/object:Gem::Version
38
39
  version: '0.6'
39
- name: cabin
40
- prerelease: false
41
- type: :runtime
42
- version_requirements: !ruby/object:Gem::Requirement
40
+ requirement: !ruby/object:Gem::Requirement
43
41
  requirements:
44
42
  - - "~>"
45
43
  - !ruby/object:Gem::Version
46
44
  version: '0.6'
45
+ prerelease: false
46
+ type: :runtime
47
47
  - !ruby/object:Gem::Dependency
48
- requirement: !ruby/object:Gem::Requirement
48
+ name: logstash-core-plugin-api
49
+ version_requirements: !ruby/object:Gem::Requirement
49
50
  requirements:
50
51
  - - ">="
51
52
  - !ruby/object:Gem::Version
@@ -53,10 +54,7 @@ dependencies:
53
54
  - - "<="
54
55
  - !ruby/object:Gem::Version
55
56
  version: '2.99'
56
- name: logstash-core-plugin-api
57
- prerelease: false
58
- type: :runtime
59
- version_requirements: !ruby/object:Gem::Requirement
57
+ requirement: !ruby/object:Gem::Requirement
60
58
  requirements:
61
59
  - - ">="
62
60
  - !ruby/object:Gem::Version
@@ -64,63 +62,74 @@ dependencies:
64
62
  - - "<="
65
63
  - !ruby/object:Gem::Version
66
64
  version: '2.99'
65
+ prerelease: false
66
+ type: :runtime
67
67
  - !ruby/object:Gem::Dependency
68
+ name: ftw
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: 0.0.42
68
74
  requirement: !ruby/object:Gem::Requirement
69
75
  requirements:
70
76
  - - "~>"
71
77
  - !ruby/object:Gem::Version
72
78
  version: 0.0.42
73
- name: ftw
74
79
  prerelease: false
75
80
  type: :development
81
+ - !ruby/object:Gem::Dependency
82
+ name: addressable
76
83
  version_requirements: !ruby/object:Gem::Requirement
77
84
  requirements:
78
85
  - - "~>"
79
86
  - !ruby/object:Gem::Version
80
- version: 0.0.42
81
- - !ruby/object:Gem::Dependency
87
+ version: 2.3.0
82
88
  requirement: !ruby/object:Gem::Requirement
83
89
  requirements:
84
90
  - - "~>"
85
91
  - !ruby/object:Gem::Version
86
92
  version: 2.3.0
87
- name: addressable
88
93
  prerelease: false
89
94
  type: :development
95
+ - !ruby/object:Gem::Dependency
96
+ name: logstash-codec-plain
90
97
  version_requirements: !ruby/object:Gem::Requirement
91
98
  requirements:
92
- - - "~>"
99
+ - - ">="
93
100
  - !ruby/object:Gem::Version
94
- version: 2.3.0
95
- - !ruby/object:Gem::Dependency
101
+ version: '0'
96
102
  requirement: !ruby/object:Gem::Requirement
97
103
  requirements:
98
104
  - - ">="
99
105
  - !ruby/object:Gem::Version
100
106
  version: '0'
101
- name: logstash-codec-plain
102
107
  prerelease: false
103
108
  type: :development
109
+ - !ruby/object:Gem::Dependency
110
+ name: json
104
111
  version_requirements: !ruby/object:Gem::Requirement
105
112
  requirements:
106
113
  - - ">="
107
114
  - !ruby/object:Gem::Version
108
115
  version: '0'
109
- - !ruby/object:Gem::Dependency
110
116
  requirement: !ruby/object:Gem::Requirement
111
117
  requirements:
112
118
  - - ">="
113
119
  - !ruby/object:Gem::Version
114
120
  version: '0'
115
- name: json
116
121
  prerelease: false
117
122
  type: :development
123
+ - !ruby/object:Gem::Dependency
124
+ name: manticore
118
125
  version_requirements: !ruby/object:Gem::Requirement
119
126
  requirements:
120
127
  - - ">="
121
128
  - !ruby/object:Gem::Version
122
- version: '0'
123
- - !ruby/object:Gem::Dependency
129
+ version: 0.5.4
130
+ - - "<"
131
+ - !ruby/object:Gem::Version
132
+ version: 1.0.0
124
133
  requirement: !ruby/object:Gem::Requirement
125
134
  requirements:
126
135
  - - ">="
@@ -129,59 +138,50 @@ dependencies:
129
138
  - - "<"
130
139
  - !ruby/object:Gem::Version
131
140
  version: 1.0.0
132
- name: manticore
133
141
  prerelease: false
134
142
  type: :runtime
143
+ - !ruby/object:Gem::Dependency
144
+ name: logstash-devutils
135
145
  version_requirements: !ruby/object:Gem::Requirement
136
146
  requirements:
137
147
  - - ">="
138
148
  - !ruby/object:Gem::Version
139
- version: 0.5.4
140
- - - "<"
141
- - !ruby/object:Gem::Version
142
- version: 1.0.0
143
- - !ruby/object:Gem::Dependency
149
+ version: '0'
144
150
  requirement: !ruby/object:Gem::Requirement
145
151
  requirements:
146
152
  - - ">="
147
153
  - !ruby/object:Gem::Version
148
154
  version: '0'
149
- name: logstash-devutils
150
155
  prerelease: false
151
156
  type: :development
157
+ - !ruby/object:Gem::Dependency
158
+ name: flores
152
159
  version_requirements: !ruby/object:Gem::Requirement
153
160
  requirements:
154
161
  - - ">="
155
162
  - !ruby/object:Gem::Version
156
163
  version: '0'
157
- - !ruby/object:Gem::Dependency
158
164
  requirement: !ruby/object:Gem::Requirement
159
165
  requirements:
160
166
  - - ">="
161
167
  - !ruby/object:Gem::Version
162
168
  version: '0'
163
- name: flores
164
169
  prerelease: false
165
170
  type: :development
171
+ - !ruby/object:Gem::Dependency
172
+ name: elasticsearch
166
173
  version_requirements: !ruby/object:Gem::Requirement
167
174
  requirements:
168
175
  - - ">="
169
176
  - !ruby/object:Gem::Version
170
177
  version: '0'
171
- - !ruby/object:Gem::Dependency
172
178
  requirement: !ruby/object:Gem::Requirement
173
179
  requirements:
174
180
  - - ">="
175
181
  - !ruby/object:Gem::Version
176
182
  version: '0'
177
- name: elasticsearch
178
183
  prerelease: false
179
184
  type: :development
180
- version_requirements: !ruby/object:Gem::Requirement
181
- requirements:
182
- - - ">="
183
- - !ruby/object:Gem::Version
184
- version: '0'
185
185
  description: This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program
186
186
  email: info@elastic.co
187
187
  executables: []