Skip to content

Commit 39a4db9

Browse files
committed
Changed conditionally addition of type to open in case of _monitoring endpoint
Fixes #900
1 parent 17f745a commit 39a4db9

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

CHANGELOG.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
## 10.2.3
2+
- Fixed 8.x type removal compatibility issue to continue for monitoring endpoint from LogStash's X-Pack[#899](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/899)
3+
14
## 10.2.2
2-
- Fixed 8.x type removal compatibility issue [#892](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/892)
5+
- Fixed 8.x type removal compatibility issue [#892](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/892)
36

47
## 10.2.1
58
- Fixed wording and corrected option in documentation [#881](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/881) [#883](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/883)
@@ -168,14 +171,14 @@
168171

169172
## 6.2.3
170173
- Fixed a bug introduced in 6.2.2 where passwords needing escapes were not actually sent to ES properly
171-
encoded.
174+
encoded.
172175

173176
## 6.2.2
174177
- Fixed a bug that forced users to URL encode the `password` option.
175178
If you are currently manually escaping your passwords upgrading to this version
176179
will break authentication. You should unescape your password if you have implemented
177180
this workaround as it will otherwise be doubly encoded.
178-
URL escaping is STILL required for passwords inline with URLs in the `hosts` option.
181+
URL escaping is STILL required for passwords inline with URLs in the `hosts` option.
179182

180183
## 6.2.1
181184
- When an HTTP error is encountered, log the response body instead of the request.
@@ -189,7 +192,7 @@
189192

190193
## 6.0.0
191194
- Proxies requiring auth now always work when a URL is specified
192-
- It is no longer possible to specify a proxy as a hash due to security reasons
195+
- It is no longer possible to specify a proxy as a hash due to security reasons
193196
- Fix URL normalization logic to correctly apply all settings to sniffed hosts
194197
- Proxies requiring auth now always work when a URL is specified
195198
- Switch internals to new LogStash::Util::SafeURI type for more defensive approach to logging credentials

lib/logstash/outputs/elasticsearch/common.rb

+5-2
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@ def successful_connection?
6262
!!maximum_seen_major_version
6363
end
6464

65+
def use_event_type?(client)
66+
client.maximum_seen_major_version < 8
67+
end
68+
6569
# Convert the event into a 3-tuple of action, params, and event
6670
def event_action_tuple(event)
67-
6871
action = event.sprintf(@action)
6972

7073
params = {
@@ -73,7 +76,7 @@ def event_action_tuple(event)
7376
routing_field_name => @routing ? event.sprintf(@routing) : nil
7477
}
7578

76-
params[:_type] = get_event_type(event) if client.maximum_seen_major_version < 8
79+
params[:_type] = get_event_type(event) if use_event_type?(client)
7780

7881
if @pipeline
7982
params[:pipeline] = event.sprintf(@pipeline)

logstash-output-elasticsearch.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'logstash-output-elasticsearch'
3-
s.version = '10.2.2'
3+
s.version = '10.2.3'
44
s.licenses = ['apache-2.0']
55
s.summary = "Stores logs in Elasticsearch"
66
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"

0 commit comments

Comments
 (0)