logstash-output-elasticsearch 11.22.13-java → 11.22.15-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db023d3f7c10e52c9a7fdd9e2480ccd0f988c977357d86b3980d0698a21f5b10
4
- data.tar.gz: f7d2ca8aa8dbb5acf848d5c20cca9911a6530fc5296d9765cc26df96df7554c0
3
+ metadata.gz: a0b7ec8d5dbede6389a4e59f97d8e98c812091e9f9a1f49ed11a443c4c7b4a6b
4
+ data.tar.gz: e0a1b09ca555fed7cd9340ce843e837b3abb0ceb0d21a577d43a3b89462042cc
5
5
  SHA512:
6
- metadata.gz: cd23a9523896c06623ec91a33ec820363af6df32149bf0d445ab1218e5b344668398b09cbcdc5b88b39efa4771d79f9de52f80d968105d991ce369cbafd634bc
7
- data.tar.gz: e63f6a22b9eb7f308c164ba9e4d63f6685305f82d9e1ef9d4e86d7c6fedb1d19d9de4fd6949b82d534f5745c33d75ec35ae6b036fcc3b8efc2f41977a6948e07
6
+ metadata.gz: 14dd08f7aa74dee3c9cadb7ff96a86a0e65e4fcb425b1292749005faac2e7153a580ab6212dabb7664f1d83997404993ec1a2f0f9efdabd834aecd5447b728f8
7
+ data.tar.gz: 1c21dd49841e4f05ddaca95e7a3f91bb9d7e9c3ee9887249ef2b365c3066db666645b3b508a173c2c9fa55256c906fa202068b2942646cac8e2cc1e3ab444b65
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 11.22.15
2
+ - Improves the logging experience when DLQ used [#1258](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1258)
3
+
4
+ ## 11.22.14
5
+ - Fix: replace deprecated `File.exists?` with `File.exist?` for Ruby 3.4 (JRuby 10) compatibility [#1238](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1238)
6
+
1
7
  ## 11.22.13
2
8
  - Add headers reporting uncompressed size and doc count for bulk requests [#1217](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1217)
3
9
 
@@ -99,7 +99,7 @@ module LogStash; module Outputs; class ElasticSearch
99
99
  end
100
100
 
101
101
  def self.read_template_file(template_path)
102
- raise LogStash::ConfigurationError, "Template file '#{template_path}' could not be found" unless ::File.exists?(template_path)
102
+ raise LogStash::ConfigurationError, "Template file '#{template_path}' could not be found" unless ::File.exist?(template_path)
103
103
  template_data = ::IO.read(template_path)
104
104
  LogStash::Json.load(template_data)
105
105
  rescue => e
@@ -241,7 +241,6 @@ module LogStash; module PluginMixins; module ElasticSearch
241
241
  @dlq_writer.write(event, "#{detailed_message}")
242
242
  else
243
243
  log_level = dig_value(response, 'index', 'error', 'type') == 'invalid_index_name_exception' ? :error : :warn
244
-
245
244
  @logger.public_send(log_level, message, status: status, action: action_params, response: response)
246
245
  end
247
246
  end
@@ -273,6 +272,7 @@ module LogStash; module PluginMixins; module ElasticSearch
273
272
  end
274
273
 
275
274
  actions_to_retry = []
275
+ dlq_routed_stats = {}
276
276
  responses.each_with_index do |response,idx|
277
277
  action_type, action_props = response.first
278
278
 
@@ -294,6 +294,11 @@ module LogStash; module PluginMixins; module ElasticSearch
294
294
  elsif @dlq_codes.include?(status)
295
295
  handle_dlq_response("Could not index event to Elasticsearch.", action, status, response)
296
296
  @document_level_metrics.increment(:dlq_routed)
297
+ if dlq_routed_stats.key?(status)
298
+ dlq_routed_stats[status][:count] += 1
299
+ else
300
+ dlq_routed_stats[status] = { :count => 1, :sample_event => { :action => action, :response => response } }
301
+ end
297
302
  next
298
303
  else
299
304
  # only log what the user whitelisted
@@ -303,6 +308,11 @@ module LogStash; module PluginMixins; module ElasticSearch
303
308
  end
304
309
  end
305
310
 
311
+ if @dlq_writer && !dlq_routed_stats.empty?
312
+ total = dlq_routed_stats.values.sum { |entry| entry[:count] }
313
+ @logger.warn("Events could not be indexed and routing to DLQ", :count => total, :dlq_routed_stats => dlq_routed_stats)
314
+ end
315
+
306
316
  actions_to_retry
307
317
  end
308
318
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-elasticsearch'
3
- s.version = '11.22.13'
3
+ s.version = '11.22.15'
4
4
  s.licenses = ['apache-2.0']
5
5
  s.summary = "Stores logs in Elasticsearch"
6
6
  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"
@@ -5,7 +5,10 @@ describe "metrics", :integration => true do
5
5
  require "logstash/outputs/elasticsearch"
6
6
  settings = {
7
7
  "manage_template" => false,
8
- "hosts" => "#{get_host_port()}"
8
+ "hosts" => "#{get_host_port()}",
9
+ # write data to a random non templated index to ensure the bulk partially fails
10
+ # don't use streams like "logs-*" as those have failure stores enabled, causing the bulk to succeed instead
11
+ "index" => "custom_index_#{rand(10000)}"
9
12
  }
10
13
  plugin = LogStash::Outputs::ElasticSearch.new(settings)
11
14
  end
@@ -1557,7 +1557,7 @@ describe LogStash::Outputs::ElasticSearch do
1557
1557
  expect( event ).to be_a LogStash::Event
1558
1558
  expect( event ).to be events.first
1559
1559
  expect( reason ).to start_with "Could not index event to Elasticsearch. status: #{error_code}, action: [\"index\""
1560
- expect( reason ).to match /_id=>"bar".*"foo"=>"bar".*response:.*"reason"=>"TEST"/
1560
+ expect( reason ).to match /_id(?::| ?=>) ?"bar".*"foo" ?=> ?"bar".*response:.*"reason" ?=> ?"TEST"/
1561
1561
 
1562
1562
  method.call(*args) # won't hurt to call LogStash::Util::DummyDeadLetterQueueWriter
1563
1563
  end.once
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.22.13
4
+ version: 11.22.15
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-01 00:00:00.000000000 Z
11
+ date: 2026-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement