logstash-input-elasticsearch 5.3.0 → 5.3.1

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: 90dc46d1bcadf70173792a9c2319925ea5e78bd3e6322e7c323de178afb72fa4
4
- data.tar.gz: 21548a5935b0aa5b153b6e1bc00c7f9f3f6ade7f6546a0beb0ce7cc6cef5a984
3
+ metadata.gz: a9727073ca11cfa69a6f7c7b2f697ddf5867cef0bba4d4e4516eb32aad0dfcd0
4
+ data.tar.gz: f48cdc3e58b58bf3d06e56edb7887b61f8a7d3b9ea01492cae2ba300d91c9a0a
5
5
  SHA512:
6
- metadata.gz: 59e8a03c25d8ee9a1a02014b75d1096b81250b85c7f6bd7e78114764534d9ad244d5d758e974c84bc20d9aa0c8fad669a3ef636b17037426c30f2705d74083d2
7
- data.tar.gz: 8b986365b25b8884e3aae581b37ce35f9190e50bf3ce4d17263887c31721efe16f16b97dcf2571dcb446991f7ea4406c6011a1d1dbd3afd7f3e07ec0c4b9b743
6
+ metadata.gz: 7f0266cbad4a06a7c65bf33dcc4bf79a58a5fd43da7ad7ee007298f9492a23dd939c73dff55eb1880ee6a4f88299946f8b5f113a8267e529cbafb00d417e4ccc
7
+ data.tar.gz: 8ae4f0721c282efa2f3384047d94aa0494adf17feb8a6061563fd65b99d6a040ebf0654d36a0f67ab41668e438d087f9473adc30a539f04eec0dc4eb9d984bb5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 5.3.1
2
+ - Fix serverless request failure caused by conflicting `compatible-with` and `Elastic-Api-Version` headers when using elasticsearch-ruby v9 [#269](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/269)
3
+
1
4
  ## 5.3.0
2
5
  - Drop a support for Logstash 7.x by requiring elasticsearch gem >= 8. Logstash 8+ continues to work as before [#252](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/252)
3
6
 
@@ -331,31 +331,7 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
331
331
  validate_authentication
332
332
  fill_user_password_from_cloud_auth
333
333
 
334
- transport_options = {:headers => {}}
335
- transport_options[:headers].merge!(INTERNAL_ORIGIN_HEADER)
336
- transport_options[:headers].merge!(setup_basic_auth(user, password))
337
- transport_options[:headers].merge!(setup_api_key(api_key))
338
- transport_options[:headers].merge!({'user-agent' => prepare_user_agent()})
339
- transport_options[:headers].merge!(@custom_headers) unless @custom_headers.empty?
340
- transport_options[:request_timeout] = @request_timeout_seconds unless @request_timeout_seconds.nil?
341
- transport_options[:connect_timeout] = @connect_timeout_seconds unless @connect_timeout_seconds.nil?
342
- transport_options[:socket_timeout] = @socket_timeout_seconds unless @socket_timeout_seconds.nil?
343
-
344
- hosts = setup_hosts
345
- ssl_options = setup_client_ssl
346
-
347
- @logger.warn "Supplied proxy setting (proxy => '') has no effect" if @proxy.eql?('')
348
-
349
- transport_options[:proxy] = @proxy.to_s if @proxy && !@proxy.eql?('')
350
-
351
- @client_options = {
352
- :hosts => hosts,
353
- :transport_options => transport_options,
354
- :transport_class => ::Elastic::Transport::Transport::HTTP::Manticore,
355
- :ssl => ssl_options
356
- }
357
-
358
- @client = Elasticsearch::Client.new(@client_options)
334
+ @client = new_client
359
335
 
360
336
  test_connection!
361
337
 
@@ -641,6 +617,31 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
641
617
  # @private used by unit specs
642
618
  attr_reader :client
643
619
 
620
+ def new_client(serverless: false)
621
+ headers = {}
622
+ headers.merge!(INTERNAL_ORIGIN_HEADER)
623
+ headers.merge!(setup_basic_auth(user, password))
624
+ headers.merge!(setup_api_key(api_key))
625
+ headers.merge!({'user-agent' => prepare_user_agent()})
626
+ headers.merge!(@custom_headers) unless @custom_headers.empty?
627
+ headers.merge!(DEFAULT_EAV_HEADER) if serverless
628
+
629
+ transport_options = { headers: headers }
630
+ transport_options[:request_timeout] = @request_timeout_seconds unless @request_timeout_seconds.nil?
631
+ transport_options[:connect_timeout] = @connect_timeout_seconds unless @connect_timeout_seconds.nil?
632
+ transport_options[:socket_timeout] = @socket_timeout_seconds unless @socket_timeout_seconds.nil?
633
+
634
+ @logger.warn "Supplied proxy setting (proxy => '') has no effect" if @proxy.eql?('')
635
+ transport_options[:proxy] = @proxy.to_s if @proxy && !@proxy.eql?('')
636
+
637
+ Elasticsearch::Client.new(
638
+ hosts: setup_hosts,
639
+ transport_options: transport_options,
640
+ transport_class: ::Elastic::Transport::Transport::HTTP::Manticore,
641
+ ssl: setup_client_ssl
642
+ )
643
+ end
644
+
644
645
  def test_connection!
645
646
  @client.ping
646
647
  rescue Elasticsearch::UnsupportedProductError
@@ -663,8 +664,7 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
663
664
  # verify the header by sending GET /
664
665
  def setup_serverless
665
666
  if serverless?
666
- @client_options[:transport_options][:headers].merge!(DEFAULT_EAV_HEADER)
667
- @client = Elasticsearch::Client.new(@client_options)
667
+ @client = new_client(serverless: true)
668
668
  @client.info
669
669
  end
670
670
  rescue => e
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.require_paths = ["lib"]
12
12
 
13
13
  # Files
14
- s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "docs/**/*"]
14
+ s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "version", "docs/**/*"]
15
15
 
16
16
  # Tests
17
17
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
data/version ADDED
@@ -0,0 +1 @@
1
+ 5.3.1
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
10
+ date: 2026-06-18 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: logstash-core-plugin-api
@@ -283,6 +283,7 @@ files:
283
283
  - spec/inputs/integration/elasticsearch_esql_spec.rb
284
284
  - spec/inputs/integration/elasticsearch_spec.rb
285
285
  - spec/inputs/paginated_search_spec.rb
286
+ - version
286
287
  homepage: https://elastic.co/logstash
287
288
  licenses:
288
289
  - Apache License (2.0)
@@ -303,7 +304,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
303
304
  - !ruby/object:Gem::Version
304
305
  version: '0'
305
306
  requirements: []
306
- rubygems_version: 3.7.2
307
+ rubygems_version: 3.6.3
307
308
  specification_version: 4
308
309
  summary: Reads query results from an Elasticsearch cluster
309
310
  test_files: