logstash-output-elasticsearch 10.8.3-java → 11.0.2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/docs/index.asciidoc +132 -22
  4. data/lib/logstash/outputs/elasticsearch.rb +134 -62
  5. data/lib/logstash/outputs/elasticsearch/data_stream_support.rb +233 -0
  6. data/lib/logstash/outputs/elasticsearch/http_client.rb +59 -21
  7. data/lib/logstash/outputs/elasticsearch/http_client/pool.rb +47 -34
  8. data/lib/logstash/outputs/elasticsearch/ilm.rb +11 -12
  9. data/lib/logstash/outputs/elasticsearch/license_checker.rb +26 -23
  10. data/lib/logstash/outputs/elasticsearch/template_manager.rb +3 -5
  11. data/lib/logstash/plugin_mixins/elasticsearch/api_configs.rb +157 -153
  12. data/lib/logstash/plugin_mixins/elasticsearch/common.rb +81 -60
  13. data/logstash-output-elasticsearch.gemspec +2 -2
  14. data/spec/es_spec_helper.rb +3 -6
  15. data/spec/integration/outputs/data_stream_spec.rb +61 -0
  16. data/spec/integration/outputs/ilm_spec.rb +22 -18
  17. data/spec/integration/outputs/ingest_pipeline_spec.rb +4 -2
  18. data/spec/integration/outputs/retry_spec.rb +4 -4
  19. data/spec/integration/outputs/sniffer_spec.rb +0 -1
  20. data/spec/spec_helper.rb +14 -0
  21. data/spec/unit/http_client_builder_spec.rb +9 -9
  22. data/spec/unit/outputs/elasticsearch/data_stream_support_spec.rb +542 -0
  23. data/spec/unit/outputs/elasticsearch/http_client/manticore_adapter_spec.rb +1 -0
  24. data/spec/unit/outputs/elasticsearch/http_client/pool_spec.rb +27 -13
  25. data/spec/unit/outputs/elasticsearch/http_client_spec.rb +59 -41
  26. data/spec/unit/outputs/elasticsearch/template_manager_spec.rb +1 -3
  27. data/spec/unit/outputs/elasticsearch_proxy_spec.rb +4 -5
  28. data/spec/unit/outputs/elasticsearch_spec.rb +278 -45
  29. data/spec/unit/outputs/elasticsearch_ssl_spec.rb +1 -2
  30. data/spec/unit/outputs/error_whitelist_spec.rb +4 -3
  31. data/spec/unit/outputs/license_check_spec.rb +0 -16
  32. metadata +23 -16
@@ -1,6 +1,5 @@
1
- require_relative "../../../spec/es_spec_helper"
1
+ require_relative "../../../spec/spec_helper"
2
2
  require 'stud/temporary'
3
- require "logstash/outputs/elasticsearch"
4
3
 
5
4
  describe "SSL option" do
6
5
  let(:manticore_double) { double("manticoreSSL #{self.inspect}") }
@@ -12,6 +12,7 @@ describe "whitelisting error types in expected behavior" do
12
12
  before :each do
13
13
  allow(subject.logger).to receive(:warn)
14
14
  allow(subject).to receive(:maximum_seen_major_version).and_return(0)
15
+ allow(subject).to receive(:finish_register)
15
16
 
16
17
  subject.register
17
18
 
@@ -39,15 +40,15 @@ describe "whitelisting error types in expected behavior" do
39
40
 
40
41
  describe "when failure logging is enabled for everything" do
41
42
  it "should log a failure on the action" do
42
- expect(subject.logger).to have_received(:warn).with("Failed action.", anything)
43
+ expect(subject.logger).to have_received(:warn).with("Failed action", anything)
43
44
  end
44
45
  end
45
46
 
46
47
  describe "when failure logging is disabled for docuemnt exists error" do
47
- let(:settings) { super.merge("failure_type_logging_whitelist" => ["document_already_exists_exception"]) }
48
+ let(:settings) { super().merge("failure_type_logging_whitelist" => ["document_already_exists_exception"]) }
48
49
 
49
50
  it "should log a failure on the action" do
50
- expect(subject.logger).not_to have_received(:warn).with("Failed action.", anything)
51
+ expect(subject.logger).not_to have_received(:warn).with("Failed action", anything)
51
52
  end
52
53
  end
53
54
 
@@ -14,22 +14,6 @@ describe LogStash::Outputs::ElasticSearch::LicenseChecker do
14
14
  end
15
15
  end
16
16
 
17
- context "LicenseChecker API required by Pool specs" do
18
- subject { described_class }
19
-
20
- it "defines the oss? method" do
21
- expect(subject.instance_methods).to include(:oss?)
22
- end
23
-
24
- it "defines the valid_es_license? method" do
25
- expect(subject.instance_methods).to include(:valid_es_license?)
26
- end
27
-
28
- it "defines the log_license_deprecation_warn method" do
29
- expect(subject.instance_methods).to include(:log_license_deprecation_warn)
30
- end
31
- end
32
-
33
17
  context "Pool class API required by the LicenseChecker" do
34
18
  subject { LogStash::Outputs::ElasticSearch::HttpClient::Pool }
35
19
 
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: 10.8.3
4
+ version: 11.0.2
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-22 00:00:00.000000000 Z
11
+ date: 2021-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -50,20 +50,6 @@ dependencies:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0.0'
53
- - !ruby/object:Gem::Dependency
54
- requirement: !ruby/object:Gem::Requirement
55
- requirements:
56
- - - "~>"
57
- - !ruby/object:Gem::Version
58
- version: '0.6'
59
- name: cabin
60
- prerelease: false
61
- type: :runtime
62
- version_requirements: !ruby/object:Gem::Requirement
63
- requirements:
64
- - - "~>"
65
- - !ruby/object:Gem::Version
66
- version: '0.6'
67
53
  - !ruby/object:Gem::Dependency
68
54
  requirement: !ruby/object:Gem::Requirement
69
55
  requirements:
@@ -140,6 +126,20 @@ dependencies:
140
126
  - - ">="
141
127
  - !ruby/object:Gem::Version
142
128
  version: '0'
129
+ - !ruby/object:Gem::Dependency
130
+ requirement: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - "~>"
133
+ - !ruby/object:Gem::Version
134
+ version: '0.6'
135
+ name: cabin
136
+ prerelease: false
137
+ type: :development
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - "~>"
141
+ - !ruby/object:Gem::Version
142
+ version: '0.6'
143
143
  - !ruby/object:Gem::Dependency
144
144
  requirement: !ruby/object:Gem::Requirement
145
145
  requirements:
@@ -170,6 +170,7 @@ files:
170
170
  - README.md
171
171
  - docs/index.asciidoc
172
172
  - lib/logstash/outputs/elasticsearch.rb
173
+ - lib/logstash/outputs/elasticsearch/data_stream_support.rb
173
174
  - lib/logstash/outputs/elasticsearch/default-ilm-policy.json
174
175
  - lib/logstash/outputs/elasticsearch/http_client.rb
175
176
  - lib/logstash/outputs/elasticsearch/http_client/manticore_adapter.rb
@@ -210,6 +211,7 @@ files:
210
211
  - spec/fixtures/test_certs/test.key
211
212
  - spec/integration/outputs/compressed_indexing_spec.rb
212
213
  - spec/integration/outputs/create_spec.rb
214
+ - spec/integration/outputs/data_stream_spec.rb
213
215
  - spec/integration/outputs/delete_spec.rb
214
216
  - spec/integration/outputs/groovy_update_spec.rb
215
217
  - spec/integration/outputs/ilm_spec.rb
@@ -226,12 +228,14 @@ files:
226
228
  - spec/integration/outputs/templates_5x_spec.rb
227
229
  - spec/integration/outputs/templates_spec.rb
228
230
  - spec/integration/outputs/update_spec.rb
231
+ - spec/spec_helper.rb
229
232
  - spec/support/elasticsearch/api/actions/delete_ilm_policy.rb
230
233
  - spec/support/elasticsearch/api/actions/get_alias.rb
231
234
  - spec/support/elasticsearch/api/actions/get_ilm_policy.rb
232
235
  - spec/support/elasticsearch/api/actions/put_alias.rb
233
236
  - spec/support/elasticsearch/api/actions/put_ilm_policy.rb
234
237
  - spec/unit/http_client_builder_spec.rb
238
+ - spec/unit/outputs/elasticsearch/data_stream_support_spec.rb
235
239
  - spec/unit/outputs/elasticsearch/http_client/manticore_adapter_spec.rb
236
240
  - spec/unit/outputs/elasticsearch/http_client/pool_spec.rb
237
241
  - spec/unit/outputs/elasticsearch/http_client_spec.rb
@@ -289,6 +293,7 @@ test_files:
289
293
  - spec/fixtures/test_certs/test.key
290
294
  - spec/integration/outputs/compressed_indexing_spec.rb
291
295
  - spec/integration/outputs/create_spec.rb
296
+ - spec/integration/outputs/data_stream_spec.rb
292
297
  - spec/integration/outputs/delete_spec.rb
293
298
  - spec/integration/outputs/groovy_update_spec.rb
294
299
  - spec/integration/outputs/ilm_spec.rb
@@ -305,12 +310,14 @@ test_files:
305
310
  - spec/integration/outputs/templates_5x_spec.rb
306
311
  - spec/integration/outputs/templates_spec.rb
307
312
  - spec/integration/outputs/update_spec.rb
313
+ - spec/spec_helper.rb
308
314
  - spec/support/elasticsearch/api/actions/delete_ilm_policy.rb
309
315
  - spec/support/elasticsearch/api/actions/get_alias.rb
310
316
  - spec/support/elasticsearch/api/actions/get_ilm_policy.rb
311
317
  - spec/support/elasticsearch/api/actions/put_alias.rb
312
318
  - spec/support/elasticsearch/api/actions/put_ilm_policy.rb
313
319
  - spec/unit/http_client_builder_spec.rb
320
+ - spec/unit/outputs/elasticsearch/data_stream_support_spec.rb
314
321
  - spec/unit/outputs/elasticsearch/http_client/manticore_adapter_spec.rb
315
322
  - spec/unit/outputs/elasticsearch/http_client/pool_spec.rb
316
323
  - spec/unit/outputs/elasticsearch/http_client_spec.rb