logstash-output-opensearch 1.0.0-java → 1.3.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/COMPATIBILITY.md +27 -0
- data/CONTRIBUTING.md +27 -5
- data/DEVELOPER_GUIDE.md +16 -7
- data/Gemfile +1 -1
- data/MAINTAINERS.md +3 -0
- data/NOTICE +9 -2
- data/README.md +75 -5
- data/lib/logstash/outputs/opensearch/http_client/manticore_adapter.rb +101 -4
- data/lib/logstash/outputs/opensearch/http_client/pool.rb +3 -16
- data/lib/logstash/outputs/opensearch/http_client.rb +12 -23
- data/lib/logstash/outputs/opensearch/http_client_builder.rb +5 -2
- data/lib/logstash/outputs/opensearch/templates/ecs-disabled/2x.json +44 -0
- data/lib/logstash/outputs/opensearch/templates/ecs-v8/1x.json +5252 -0
- data/lib/logstash/outputs/opensearch/templates/ecs-v8/2x.json +5252 -0
- data/lib/logstash/outputs/opensearch/templates/ecs-v8/7x.json +5252 -0
- data/lib/logstash/outputs/opensearch.rb +4 -5
- data/lib/logstash/plugin_mixins/opensearch/api_configs.rb +26 -0
- data/lib/logstash/plugin_mixins/opensearch/common.rb +2 -2
- data/logstash-output-opensearch.gemspec +20 -4
- data/spec/integration/outputs/compressed_indexing_spec.rb +11 -5
- data/spec/integration/outputs/create_spec.rb +7 -7
- data/spec/integration/outputs/delete_spec.rb +8 -8
- data/spec/integration/outputs/index_spec.rb +54 -12
- data/spec/integration/outputs/index_version_spec.rb +11 -11
- data/spec/integration/outputs/ingest_pipeline_spec.rb +3 -4
- data/spec/integration/outputs/metrics_spec.rb +0 -2
- data/spec/integration/outputs/no_opensearch_on_startup_spec.rb +0 -1
- data/spec/integration/outputs/painless_update_spec.rb +10 -10
- data/spec/integration/outputs/parent_spec.rb +2 -2
- data/spec/integration/outputs/retry_spec.rb +2 -2
- data/spec/integration/outputs/sniffer_spec.rb +2 -2
- data/spec/integration/outputs/templates_spec.rb +83 -59
- data/spec/integration/outputs/update_spec.rb +14 -14
- data/spec/opensearch_spec_helper.rb +12 -2
- data/spec/unit/outputs/opensearch/http_client/manticore_adapter_spec.rb +74 -4
- data/spec/unit/outputs/opensearch/http_client/pool_spec.rb +4 -87
- data/spec/unit/outputs/opensearch/http_client_spec.rb +6 -5
- data/spec/unit/outputs/opensearch/template_manager_spec.rb +23 -4
- data/spec/unit/outputs/opensearch_spec.rb +18 -2
- data.tar.gz.sig +0 -0
- metadata +75 -19
- metadata.gz.sig +0 -0
- data/lib/logstash/outputs/opensearch/distribution_checker.rb +0 -44
- data/lib/logstash/plugin_mixins/opensearch/noop_distribution_checker.rb +0 -18
@@ -12,6 +12,7 @@ require "base64"
|
|
12
12
|
require "flores/random"
|
13
13
|
require 'concurrent/atomic/count_down_latch'
|
14
14
|
require "logstash/outputs/opensearch"
|
15
|
+
require 'logstash/plugin_mixins/ecs_compatibility_support/spec_helper'
|
15
16
|
|
16
17
|
describe LogStash::Outputs::OpenSearch do
|
17
18
|
subject(:opensearch_output_instance) { described_class.new(options) }
|
@@ -325,7 +326,7 @@ describe LogStash::Outputs::OpenSearch do
|
|
325
326
|
end
|
326
327
|
|
327
328
|
context '413 errors' do
|
328
|
-
let(:payload_size) {
|
329
|
+
let(:payload_size) { subject.client.target_bulk_bytes + 1024 }
|
329
330
|
let(:event) { ::LogStash::Event.new("message" => ("a" * payload_size ) ) }
|
330
331
|
|
331
332
|
let(:logger_stub) { double("logger").as_null_object }
|
@@ -357,7 +358,7 @@ describe LogStash::Outputs::OpenSearch do
|
|
357
358
|
|
358
359
|
expect(logger_stub).to have_received(:warn)
|
359
360
|
.with(a_string_matching(/413 Payload Too Large/),
|
360
|
-
hash_including(:action_count => 1, :content_length => a_value >
|
361
|
+
hash_including(:action_count => 1, :content_length => a_value > subject.client.target_bulk_bytes))
|
361
362
|
end
|
362
363
|
end
|
363
364
|
|
@@ -784,6 +785,21 @@ describe LogStash::Outputs::OpenSearch do
|
|
784
785
|
end
|
785
786
|
end
|
786
787
|
|
788
|
+
describe 'ecs_compatibility support', :ecs_compatibility_support do
|
789
|
+
[:disabled, :v1, :v8].each do |ecs_compatibility|
|
790
|
+
context "when `ecs_compatibility => #{ecs_compatibility}`" do
|
791
|
+
let(:options) { Hash.new }
|
792
|
+
subject(:output) { described_class.new(options.merge("ecs_compatibility" => "#{ecs_compatibility}")) }
|
793
|
+
context 'when registered' do
|
794
|
+
before(:each) { output.register }
|
795
|
+
it 'has the correct effective ECS compatibility setting' do
|
796
|
+
expect(output.ecs_compatibility).to eq(ecs_compatibility)
|
797
|
+
end
|
798
|
+
end
|
799
|
+
end
|
800
|
+
end
|
801
|
+
end
|
802
|
+
|
787
803
|
@private
|
788
804
|
|
789
805
|
def stub_manticore_client!(manticore_double = nil)
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-opensearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Elastic
|
@@ -13,7 +13,7 @@ cert_chain:
|
|
13
13
|
-----BEGIN CERTIFICATE-----
|
14
14
|
MIIDfDCCAmSgAwIBAgIBATANBgkqhkiG9w0BAQUFADBCMRMwEQYDVQQDDApvcGVu
|
15
15
|
c2VhcmNoMRYwFAYKCZImiZPyLGQBGRYGYW1hem9uMRMwEQYKCZImiZPyLGQBGRYD
|
16
|
-
|
16
|
+
Y29tMB4XDTIyMDgxNzE3NTIzNFoXDTIzMDgxNzE3NTIzNFowQjETMBEGA1UEAwwK
|
17
17
|
b3BlbnNlYXJjaDEWMBQGCgmSJomT8ixkARkWBmFtYXpvbjETMBEGCgmSJomT8ixk
|
18
18
|
ARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM1z3/jcitjV
|
19
19
|
umXwRFn+JSBBd36qZB54Dtucf6+E2fmNPzBRhgYN5XJy/+clQJ9NIJV7C8H52P3V
|
@@ -24,14 +24,14 @@ cert_chain:
|
|
24
24
|
zfR37/NQFkECAwEAAaN9MHswCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
|
25
25
|
BBYEFJJ2myhLXK742btavNbG0IWrMNBIMCAGA1UdEQQZMBeBFW9wZW5zZWFyY2hA
|
26
26
|
YW1hem9uLmNvbTAgBgNVHRIEGTAXgRVvcGVuc2VhcmNoQGFtYXpvbi5jb20wDQYJ
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
KoZIhvcNAQEFBQADggEBAH5pWLYwKWFh1OjdCReGz/VEAiF4jXXputoN5Z8ga+1Z
|
28
|
+
lg8/diJf0PlP2B46PdmxH/TVc/o+qglNO2cHVEp8xZfEd83dfioOBeK90URQUpC5
|
29
|
+
UZmO0LZusg46SQKwKa2ukpIy2fNi3PeHRiV+W2Zv69GoWppyLun+fMez7wVoah2r
|
30
|
+
r5ROUYuAvFUvga1Vm+49pKiPM5n+MAYP5t/vWhgymY3SYQ1TfewkvKAFiFXikOR+
|
31
|
+
r+j7FLyKuk5DzIxiCp8QN5dU71BbGUmsHf/C5UV76WLPOFX/szeaHhPwpjR3sK7r
|
32
|
+
5zLgCV1KP7cgDdCYMlmZGeSViU8NV+Yy8/ghrzGpqVw=
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2022-08-17 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,23 +56,23 @@ dependencies:
|
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0.0'
|
62
59
|
- - ">="
|
63
60
|
- !ruby/object:Gem::Version
|
64
61
|
version: 0.0.17
|
62
|
+
- - "~>"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0.0'
|
65
65
|
name: stud
|
66
66
|
prerelease: false
|
67
67
|
type: :runtime
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
- - "~>"
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: '0.0'
|
73
70
|
- - ">="
|
74
71
|
- !ruby/object:Gem::Version
|
75
72
|
version: 0.0.17
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.0'
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
@@ -107,6 +107,46 @@ dependencies:
|
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '1.0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: 2.11.632
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '2'
|
119
|
+
name: aws-sdk
|
120
|
+
prerelease: false
|
121
|
+
type: :runtime
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: 2.11.632
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '2'
|
130
|
+
- !ruby/object:Gem::Dependency
|
131
|
+
requirement: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: 2.3.0
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '2'
|
139
|
+
name: json
|
140
|
+
prerelease: false
|
141
|
+
type: :runtime
|
142
|
+
version_requirements: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ">="
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: 2.3.0
|
147
|
+
- - "~>"
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '2'
|
110
150
|
- !ruby/object:Gem::Dependency
|
111
151
|
requirement: !ruby/object:Gem::Requirement
|
112
152
|
requirements:
|
@@ -163,6 +203,20 @@ dependencies:
|
|
163
203
|
- - "~>"
|
164
204
|
- !ruby/object:Gem::Version
|
165
205
|
version: '0.6'
|
206
|
+
- !ruby/object:Gem::Dependency
|
207
|
+
requirement: !ruby/object:Gem::Requirement
|
208
|
+
requirements:
|
209
|
+
- - "~>"
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
version: '1'
|
212
|
+
name: opensearch-ruby
|
213
|
+
prerelease: false
|
214
|
+
type: :development
|
215
|
+
version_requirements: !ruby/object:Gem::Requirement
|
216
|
+
requirements:
|
217
|
+
- - "~>"
|
218
|
+
- !ruby/object:Gem::Version
|
219
|
+
version: '1'
|
166
220
|
description: This gem is a Logstash plugin required to be installed on top of the
|
167
221
|
Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gem. This gem
|
168
222
|
is not a stand-alone program
|
@@ -173,6 +227,7 @@ extra_rdoc_files: []
|
|
173
227
|
files:
|
174
228
|
- ADMINS.md
|
175
229
|
- CODE_OF_CONDUCT.md
|
230
|
+
- COMPATIBILITY.md
|
176
231
|
- CONTRIBUTING.md
|
177
232
|
- DEVELOPER_GUIDE.md
|
178
233
|
- Gemfile
|
@@ -183,17 +238,19 @@ files:
|
|
183
238
|
- RELEASING.md
|
184
239
|
- SECURITY.md
|
185
240
|
- lib/logstash/outputs/opensearch.rb
|
186
|
-
- lib/logstash/outputs/opensearch/distribution_checker.rb
|
187
241
|
- lib/logstash/outputs/opensearch/http_client.rb
|
188
242
|
- lib/logstash/outputs/opensearch/http_client/manticore_adapter.rb
|
189
243
|
- lib/logstash/outputs/opensearch/http_client/pool.rb
|
190
244
|
- lib/logstash/outputs/opensearch/http_client_builder.rb
|
191
245
|
- lib/logstash/outputs/opensearch/template_manager.rb
|
192
246
|
- lib/logstash/outputs/opensearch/templates/ecs-disabled/1x.json
|
247
|
+
- lib/logstash/outputs/opensearch/templates/ecs-disabled/2x.json
|
193
248
|
- lib/logstash/outputs/opensearch/templates/ecs-disabled/7x.json
|
249
|
+
- lib/logstash/outputs/opensearch/templates/ecs-v8/1x.json
|
250
|
+
- lib/logstash/outputs/opensearch/templates/ecs-v8/2x.json
|
251
|
+
- lib/logstash/outputs/opensearch/templates/ecs-v8/7x.json
|
194
252
|
- lib/logstash/plugin_mixins/opensearch/api_configs.rb
|
195
253
|
- lib/logstash/plugin_mixins/opensearch/common.rb
|
196
|
-
- lib/logstash/plugin_mixins/opensearch/noop_distribution_checker.rb
|
197
254
|
- logstash-output-opensearch.gemspec
|
198
255
|
- spec/fixtures/_nodes/nodes.json
|
199
256
|
- spec/fixtures/htpasswd
|
@@ -249,8 +306,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
306
|
- !ruby/object:Gem::Version
|
250
307
|
version: '0'
|
251
308
|
requirements: []
|
252
|
-
|
253
|
-
rubygems_version: 2.7.10
|
309
|
+
rubygems_version: 3.3.20
|
254
310
|
signing_key:
|
255
311
|
specification_version: 4
|
256
312
|
summary: Stores logs in OpenSearch
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# SPDX-License-Identifier: Apache-2.0
|
2
|
-
#
|
3
|
-
# The OpenSearch Contributors require contributions made to
|
4
|
-
# this file be licensed under the Apache-2.0 license or a
|
5
|
-
# compatible open source license.
|
6
|
-
#
|
7
|
-
# Modifications Copyright OpenSearch Contributors. See
|
8
|
-
# GitHub history for details.
|
9
|
-
#
|
10
|
-
module LogStash; module Outputs; class OpenSearch
|
11
|
-
class DistributionChecker
|
12
|
-
|
13
|
-
def initialize(logger)
|
14
|
-
@logger = logger
|
15
|
-
end
|
16
|
-
|
17
|
-
# Checks whether connecting cluster is one of supported distribution or not
|
18
|
-
# @param pool
|
19
|
-
# @param url [LogStash::Util::SafeURI] OpenSearch node URL
|
20
|
-
# @param major_version OpenSearch major version number
|
21
|
-
# @return [Boolean] true if supported
|
22
|
-
def is_supported?(pool, url, major_version)
|
23
|
-
distribution = get_distribution(pool, url)
|
24
|
-
case distribution
|
25
|
-
when 'opensearch'
|
26
|
-
return true
|
27
|
-
when 'oss'
|
28
|
-
if major_version == 7
|
29
|
-
return true
|
30
|
-
end
|
31
|
-
end
|
32
|
-
log_not_supported(url, major_version, distribution)
|
33
|
-
false
|
34
|
-
end
|
35
|
-
|
36
|
-
def get_distribution(pool, url)
|
37
|
-
pool.get_distribution(url)
|
38
|
-
end
|
39
|
-
|
40
|
-
def log_not_supported(url, major_version, distribution)
|
41
|
-
@logger.error("Could not connect to cluster", url: url.sanitized.to_s, distribution: distribution, major_version: major_version)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end; end; end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# SPDX-License-Identifier: Apache-2.0
|
2
|
-
#
|
3
|
-
# The OpenSearch Contributors require contributions made to
|
4
|
-
# this file be licensed under the Apache-2.0 license or a
|
5
|
-
# compatible open source license.
|
6
|
-
#
|
7
|
-
# Modifications Copyright OpenSearch Contributors. See
|
8
|
-
# GitHub history for details.
|
9
|
-
|
10
|
-
module LogStash; module PluginMixins; module OpenSearch
|
11
|
-
class NoopDistributionChecker
|
12
|
-
INSTANCE = self.new
|
13
|
-
|
14
|
-
def is_supported?(pool, url, major_version)
|
15
|
-
true
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end; end; end
|