Skip to content

Commit

Permalink
Replace document_already_exist_exception with version_conflict_engine…
Browse files Browse the repository at this point in the history
…_exception in the silence_errors_in_log setting example (#1159)

* Replace in the example for silence_errors_in_log the deprecated document_already_exists_exception with version_conflict_engine_exception
  • Loading branch information
herrBez committed Nov 9, 2023
1 parent a2674cf commit 2abec75
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 11.20.1
- Replace `document_already_exist_exception` with `version_conflict_engine_exception` in the `silence_errors_in_log` setting example [#1159](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1159)

## 11.20.0
- Changed the register to initiate pipeline shutdown upon bootstrap failure instead of simply logging the error [#1151](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1151)

Expand Down
4 changes: 2 additions & 2 deletions docs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -988,12 +988,12 @@ if enabled, script is in charge of creating non-existent document (scripted upda

Defines the list of Elasticsearch errors that you don't want to log.
A useful example is when you want to skip all 409 errors
which are `document_already_exists_exception`.
which are `version_conflict_engine_exception`.

[source,ruby]
output {
elasticsearch {
silence_errors_in_log => ["document_already_exists_exception"]
silence_errors_in_log => ["version_conflict_engine_exception"]
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/logstash/plugin_mixins/elasticsearch/api_configs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module APIConfigs

# Defines the list of Elasticsearch errors that you don't want to log.
# A useful example is when you want to skip all 409 errors
# which are `document_already_exists_exception`.
# which are `version_conflict_engine_exception`.
# Deprecates `failure_type_logging_whitelist`.
:silence_errors_in_log => { :validate => :array, :default => [] },

Expand Down
2 changes: 1 addition & 1 deletion logstash-output-elasticsearch.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'logstash-output-elasticsearch'
s.version = '11.20.0'
s.version = '11.20.1'
s.licenses = ['apache-2.0']
s.summary = "Stores logs in Elasticsearch"
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"
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/outputs/error_whitelist_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"create" => {
"status" => 409,
"error" => {
"type" => "document_already_exists_exception",
"type" => "version_conflict_engine_exception",
"reason" => "[shard] document already exists"
}
}
Expand All @@ -46,7 +46,7 @@
end

describe "when failure logging is disabled for document exists error" do
let(:settings) { super().merge("silence_errors_in_log" => ["document_already_exists_exception"]) }
let(:settings) { super().merge("silence_errors_in_log" => ["version_conflict_engine_exception"]) }

it "should log a failure on the action" do
expect(subject.logger).not_to have_received(:warn).with("Failed action", anything)
Expand Down

0 comments on commit 2abec75

Please sign in to comment.