Skip to content

Commit 2088bdc

Browse files
committed
Deprecates option in favor of
1 parent 1cab1ad commit 2088bdc

File tree

5 files changed

+37
-6
lines changed

5 files changed

+37
-6
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## Unreleased
2+
- Feature: deprecates the `failure_type_logging_whitelist` configuration option, renaming it `log_silenced_errors` [#n](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/n)
3+
14
## 11.6.0
25
- Added support for `ca_trusted_fingerprint` when run on Logstash 8.3+ [#1074](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1074)
36

docs/index.asciidoc

+21-3
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ This plugin supports the following configuration options plus the
332332
| <<plugins-{type}s-{plugin}-index>> |<<string,string>>|No
333333
| <<plugins-{type}s-{plugin}-keystore>> |a valid filesystem path|No
334334
| <<plugins-{type}s-{plugin}-keystore_password>> |<<password,password>>|No
335+
| <<plugins-{type}s-{plugin}-log_silenced_errors>> |<<array,array>>|No
335336
| <<plugins-{type}s-{plugin}-manage_template>> |<<boolean,boolean>>|No
336337
| <<plugins-{type}s-{plugin}-parameters>> |<<hash,hash>>|No
337338
| <<plugins-{type}s-{plugin}-parent>> |<<string,string>>|No
@@ -584,9 +585,7 @@ of this setting affects the _default_ values of:
584585
* Value type is <<array,array>>
585586
* Default value is `[]`
586587

587-
Set the Elasticsearch errors in the whitelist that you don't want to log.
588-
A useful example is when you want to skip all 409 errors
589-
which are `document_already_exists_exception`.
588+
NOTE: Deprecated, refer to <<plugins-{type}s-{plugin}-log_silenced_errors>>.
590589

591590
[id="plugins-{type}s-{plugin}-custom_headers"]
592591
===== `custom_headers`
@@ -762,6 +761,25 @@ It can be either .jks or .p12
762761

763762
Set the keystore password
764763

764+
[id="plugins-{type}s-{plugin}-log_silenced_errors"]
765+
===== `log_silenced_errors`
766+
767+
* Value type is <<array,array>>
768+
* Default value is `[]`
769+
770+
Defines the list of Elasticsearch errors that you don't want to log.
771+
A useful example is when you want to skip all 409 errors
772+
which are `document_already_exists_exception`.
773+
774+
[source,ruby]
775+
output {
776+
elasticsearch {
777+
log_silenced_errors => ["document_already_exists_exception"]
778+
}
779+
}
780+
781+
NOTE: Deprecates <<plugins-{type}s-{plugin}-failure_type_logging_whitelist>>.
782+
765783
[id="plugins-{type}s-{plugin}-manage_template"]
766784
===== `manage_template`
767785

lib/logstash/outputs/elasticsearch.rb

+6
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ def initialize(*params)
266266
end
267267

268268
def register
269+
if !failure_type_logging_whitelist.empty?
270+
@deprecation_logger.deprecated "'failure_type_logging_whitelist' is deprecated and in a future version of " +
271+
"Elasticsearch output plugin will be removed, please use 'log_silenced_errors' instead."
272+
log_silenced_errors = log_silenced_errors | failure_type_logging_whitelist
273+
end
274+
269275
@after_successful_connection_done = Concurrent::AtomicBoolean.new(false)
270276
@stopping = Concurrent::AtomicBoolean.new(false)
271277

lib/logstash/plugin_mixins/elasticsearch/api_configs.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,14 @@ module APIConfigs
9999
# a timeout occurs, the request will be retried.
100100
:timeout => { :validate => :number, :default => 60 },
101101

102-
# Set the Elasticsearch errors in the whitelist that you don't want to log.
102+
# Deprecated, refer to `log_silenced_errors`.
103+
:failure_type_logging_whitelist => { :validate => :array, :default => [] },
104+
105+
# Defines the list of Elasticsearch errors that you don't want to log.
103106
# A useful example is when you want to skip all 409 errors
104107
# which are `document_already_exists_exception`.
105-
:failure_type_logging_whitelist => { :validate => :array, :default => [] },
108+
# Deprecates `failure_type_logging_whitelist`.
109+
:log_silenced_errors => { :validate => :array, :default => [] },
106110

107111
# While the output tries to reuse connections efficiently we have a maximum.
108112
# This sets the maximum number of open connections the output will create.

lib/logstash/plugin_mixins/elasticsearch/common.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def submit(actions)
284284
end
285285

286286
def log_failure_type?(failure)
287-
!failure_type_logging_whitelist.include?(failure["type"])
287+
!log_silenced_errors.include?(failure["type"])
288288
end
289289

290290
# Rescue retryable errors during bulk submission

0 commit comments

Comments
 (0)