Skip to content

Commit 5dee3ba

Browse files
committed
fix breakage caused by external use of our internal API
1 parent e7116f4 commit 5dee3ba

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/logstash/outputs/elasticsearch/common.rb

+9-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ def successful_connection?
6060
!!maximum_seen_major_version
6161
end
6262

63-
def use_event_type?
63+
##
64+
# WARNING: This method is overridden in a subclass in Logstash Core 7.7-7.8's monitoring,
65+
# where a `client` argument is both required and ignored. In later versions of
66+
# Logstash Core it is optional and ignored, but to make it optional here would
67+
# allow us to accidentally break compatibility with Logstashes where it was required.
68+
# @param noop_required_client [nil]: required `nil` for legacy reasons.
69+
# @return [Boolean]
70+
def use_event_type?(noop_required_client)
6471
maximum_seen_major_version < 8
6572
end
6673

@@ -74,7 +81,7 @@ def event_action_tuple(event)
7481
routing_field_name => @routing ? event.sprintf(@routing) : nil
7582
}
7683

77-
params[:_type] = get_event_type(event) if use_event_type?
84+
params[:_type] = get_event_type(event) if use_event_type?(nil)
7885

7986
if @pipeline
8087
params[:pipeline] = event.sprintf(@pipeline)

0 commit comments

Comments
 (0)