Skip to content

Commit 95374ff

Browse files
committed
Deprecates option in favor of
1 parent fe0a241 commit 95374ff

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.4.2
25
- [DOC] Add `v8` to supported values for ecs_compatiblity defaults [#1059](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1059)
36

docs/index.asciidoc

+21-3
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ This plugin supports the following configuration options plus the
331331
| <<plugins-{type}s-{plugin}-index>> |<<string,string>>|No
332332
| <<plugins-{type}s-{plugin}-keystore>> |a valid filesystem path|No
333333
| <<plugins-{type}s-{plugin}-keystore_password>> |<<password,password>>|No
334+
| <<plugins-{type}s-{plugin}-log_silenced_errors>> |<<array,array>>|No
334335
| <<plugins-{type}s-{plugin}-manage_template>> |<<boolean,boolean>>|No
335336
| <<plugins-{type}s-{plugin}-parameters>> |<<hash,hash>>|No
336337
| <<plugins-{type}s-{plugin}-parent>> |<<string,string>>|No
@@ -573,9 +574,7 @@ of this setting affects the _default_ values of:
573574
* Value type is <<array,array>>
574575
* Default value is `[]`
575576

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

580579
[id="plugins-{type}s-{plugin}-custom_headers"]
581580
===== `custom_headers`
@@ -752,6 +751,25 @@ It can be either .jks or .p12
752751

753752
Set the keystore password
754753

754+
[id="plugins-{type}s-{plugin}-log_silenced_errors"]
755+
===== `log_silenced_errors`
756+
757+
* Value type is <<array,array>>
758+
* Default value is `[]`
759+
760+
Defines the list of Elasticsearch errors that you don't want to log.
761+
A useful example is when you want to skip all 409 errors
762+
which are `document_already_exists_exception`.
763+
764+
[source,ruby]
765+
output {
766+
elasticsearch {
767+
log_silenced_errors => ["document_already_exists_exception"]
768+
}
769+
}
770+
771+
NOTE: Deprecates <<plugins-{type}s-{plugin}-failure_type_logging_whitelist>>.
772+
755773
[id="plugins-{type}s-{plugin}-manage_template"]
756774
===== `manage_template`
757775

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
@@ -91,10 +91,14 @@ module APIConfigs
9191
# a timeout occurs, the request will be retried.
9292
:timeout => { :validate => :number, :default => 60 },
9393

94-
# Set the Elasticsearch errors in the whitelist that you don't want to log.
94+
# Deprecated, refer to `log_silenced_errors`.
95+
:failure_type_logging_whitelist => { :validate => :array, :default => [] },
96+
97+
# Defines the list of Elasticsearch errors that you don't want to log.
9598
# A useful example is when you want to skip all 409 errors
9699
# which are `document_already_exists_exception`.
97-
:failure_type_logging_whitelist => { :validate => :array, :default => [] },
100+
# Deprecates `failure_type_logging_whitelist`.
101+
:log_silenced_errors => { :validate => :array, :default => [] },
98102

99103
# While the output tries to reuse connections efficiently we have a maximum.
100104
# 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
@@ -279,7 +279,7 @@ def submit(actions)
279279
end
280280

281281
def log_failure_type?(failure)
282-
!failure_type_logging_whitelist.include?(failure["type"])
282+
!log_silenced_errors.include?(failure["type"])
283283
end
284284

285285
# Rescue retryable errors during bulk submission

0 commit comments

Comments
 (0)