logstash-output-elasticsearch 11.4.0-java → 11.4.2-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3932944b80f3ae81063657ab9255cb9504624d1c6c0634c547b69b38d4a9b4a9
4
- data.tar.gz: b850f5abbe8ae00b62e379d6f7c90802172602f23a3ab0e3f67b1a4d8319bbea
3
+ metadata.gz: a5aa752898bbe2a9417fc15ec7fb1e9a55a804a03c84cef30a936206d5b97005
4
+ data.tar.gz: 89ec0c8d8ff45e4ef4892c6b2a2a5de3f108d07443f925a897e058e79987fcba
5
5
  SHA512:
6
- metadata.gz: 5bc64de78f7ca0808e377595774f63b874d753801bbee8722bcd58af6a556e9c8baae683359179b65ee5a282c321c40dbeda838a9caacb5fc7ff14e7fe63e294
7
- data.tar.gz: 0ff0a9731418cb7858e51109c8392d4a7692629d85141eedfa7019d99bbc12d7b9f016bd21d976f390ba5d745e039be6998742107b0eded2525a8c4dc7d0bf5f
6
+ metadata.gz: 633594b5c0010ca14c42231f8f1851bfdadd17819b61ea75f90d89c5db805d20d1a809ade265aedd432d80138965bdca18ec66819f387f69452f10d07a2ddb88
7
+ data.tar.gz: 9b4b8afaf80c0a9eebe7f7443c4fba5073c73823de87259641d373be62b9f52eb72e527d28d1dd4aca724abb487e13d1f49eff16f5ea0d528ab2ac7722522317
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 11.4.2
2
+ - Fixes an issue where events containing non-unicode strings could fail to serialize correctly when compression is enabled [#1169](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1169)
3
+
4
+ ## 11.4.1
5
+ - Feat: upgrade manticore (http-client) library [#1063](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1063)
6
+ - the underlying changes include latest HttpClient (4.5.13)
7
+ - resolves an old issue with `ssl_certificate_verification => false` still doing some verification logic
8
+
1
9
  ## 11.4.0
2
10
  - Updates ECS templates [#1062](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1062)
3
11
  - Updates v1 templates to 1.12.1 for use with Elasticsearch 7.x and 8.x
data/Gemfile CHANGED
@@ -12,4 +12,5 @@ end
12
12
 
13
13
  if RUBY_VERSION == "1.9.3"
14
14
  gem 'rake', '12.2.1'
15
- end
15
+ end
16
+
data/docs/index.asciidoc CHANGED
@@ -293,6 +293,11 @@ index level and `monitoring` permissions at cluster level. The `monitoring`
293
293
  permission at cluster level is necessary to perform periodic connectivity
294
294
  checks.
295
295
 
296
+ [id="plugins-{type}s-{plugin}-handling-non-utf-8"]
297
+ ==== Handling non UTF-8 data
298
+
299
+ This plugin transmits events to Elasticsearch using a JSON API, and therefore requires that all string values in events to be valid UTF-8.
300
+ When a string value on an event contains one or more byte sequences that are not valid in UTF-8, each offending byte sequence is replaced with the UTF-8 replacement character (`\uFFFD`).
296
301
 
297
302
  [id="plugins-{type}s-{plugin}-options"]
298
303
  ==== Elasticsearch Output Configuration Options
@@ -127,6 +127,9 @@ module LogStash; module Outputs; class ElasticSearch;
127
127
  action.map {|line| LogStash::Json.dump(line)}.join("\n") :
128
128
  LogStash::Json.dump(action)
129
129
  as_json << "\n"
130
+
131
+ as_json.scrub! # ensure generated JSON is valid UTF-8
132
+
130
133
  if (stream_writer.pos + as_json.bytesize) > TARGET_BULK_BYTES && stream_writer.pos > 0
131
134
  stream_writer.flush # ensure writer has sync'd buffers before reporting sizes
132
135
  logger.debug("Sending partial bulk request for batch with one or more actions remaining.",
@@ -133,12 +133,9 @@ module LogStash; module Outputs; class ElasticSearch;
133
133
  ssl_options[:keystore_password] = keystore_password.value if keystore_password
134
134
  end
135
135
  if !params["ssl_certificate_verification"]
136
- logger.warn [
137
- "** WARNING ** Detected UNSAFE options in elasticsearch output configuration!",
138
- "** WARNING ** You have enabled encryption but DISABLED certificate verification.",
139
- "** WARNING ** To make sure your data is secure change :ssl_certificate_verification to true"
140
- ].join("\n")
141
- ssl_options[:verify] = false
136
+ logger.warn "You have enabled encryption but DISABLED certificate verification, " +
137
+ "to make sure your data is secure remove `ssl_certificate_verification => false`"
138
+ ssl_options[:verify] = :disable # false accepts self-signed but still validates hostname
142
139
  end
143
140
  { ssl: ssl_options }
144
141
  end
@@ -4,7 +4,7 @@
4
4
  ],
5
5
  "mappings": {
6
6
  "_meta": {
7
- "version": "8.0.0-dev"
7
+ "version": "8.0.1"
8
8
  },
9
9
  "date_detection": false,
10
10
  "dynamic_templates": [
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "mappings": {
17
17
  "_meta": {
18
- "version": "8.0.0-dev"
18
+ "version": "8.0.1"
19
19
  },
20
20
  "date_detection": false,
21
21
  "dynamic_templates": [
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-elasticsearch'
3
- s.version = '11.4.0'
3
+ s.version = '11.4.2'
4
4
 
5
5
  s.licenses = ['apache-2.0']
6
6
  s.summary = "Stores logs in Elasticsearch"
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  # Special flag to let us know this is actually a logstash plugin
22
22
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" }
23
23
 
24
- s.add_runtime_dependency "manticore", '>= 0.7.1', '< 1.0.0'
24
+ s.add_runtime_dependency "manticore", '>= 0.8.0', '< 1.0.0'
25
25
  s.add_runtime_dependency 'stud', ['>= 0.0.17', '~> 0.0']
26
26
  s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
27
27
  s.add_runtime_dependency 'logstash-mixin-ecs_compatibility_support', '~>1.0'
@@ -0,0 +1,31 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIFRTCCAy2gAwIBAgIBATANBgkqhkiG9w0BAQsFADBMMQswCQYDVQQGEwJQVDEL
3
+ MAkGA1UECAwCTkExDzANBgNVBAcMBkxpc2JvbjEOMAwGA1UECgwFTXlMYWIxDzAN
4
+ BgNVBAMMBlJvb3RDQTAeFw0yNDAzMTkyMjM3MTdaFw0yNTAzMTkyM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W9zakYT7fivCUbt0VtS0jzhAlbaLfksJk+Emg+kpsy/CdFr8nk9jlpN
21
+ XJMKwjQIVGYDDlJsP9VDw2m+HhUugEpx09QCREaCWCDtobE9bd42VloPd0u3VWZx
22
+ u5rSrZCy5wjFeq3dPEFPyDTfV6p1kXkwy9pdG3ww0rw0dqj5OqcGhLyG8b7q7LLP
23
+ aFVuwjnutrBJtDNOsvbD/dyybQVj3hF1IpVZLwoFQ3ji43/X3NJ5jdo/WrwwdwbH
24
+ NE6YxNlsIrql4sJFeHzNukTxcC5wHcOLtc6E6dhe7uK+5rRD75+odz85rPLsBTPt
25
+ zje8OWyxO1cGol7inpKUsO9ITFQdDC9iyRjvDRouwneT+XeVwW6BmAKg4DvXdLtQ
26
+ oQNLlMbbZWskvWoI4amXwSpzWmn4mRK3e4IPWFju64QRvkEExFynvC69jeih5Llh
27
+ JU3OjLobG4wKOQHB7w1UjiPJNsxGB0P1zug6ztTBLjsvJoxdJuIGkCsI7g12cKNR
28
+ PbXp8453klofFpMNGlCP8dns92Qu20pPvYJcWiC9k42nYu3FHDMbAfSrFU90RNS6
29
+ hRWkpXZOMIY1GdudgsxanDtJgFRbkPzwNkMcBQ1538f9U4MrJ9vPsuKx4bYbZ//8
30
+ pIe/z3b1V9zV
31
+ -----END CERTIFICATE-----
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+ cd "$(dirname "$0")"
5
+
6
+ openssl x509 -x509toreq -copy_extensions copyall -in ca.crt -signkey ca.key -out ca.csr
7
+ openssl x509 -req -copy_extensions copyall -days 365 -in ca.csr -set_serial 0x01 -signkey ca.key -out ca.crt && rm ca.csr
8
+
9
+ openssl x509 -x509toreq -copy_extensions copyall -in test.crt -signkey test.key -out test.csr
10
+ openssl x509 -req -copy_extensions copyall -days 365 -in test.csr -set_serial 0x01 -CA ca.crt -CAkey ca.key -out test.crt && rm test.csr
11
+ openssl pkcs12 -export -inkey test.key -in test.crt -passout "pass:1234567890" -out test.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+MO+0DylqgIY+0u/zt
41
+ HbfKl+cbImCuRWzUZFzb6lo3uEJeUZa0UjrxykYCupzMNJ15ezXYxSsWgH58ah/0
42
+ 6uqw0I8XwJM6mWY7BQvhixUXmeOgRBFBaNaLBe/bvvEideoEAXgLWw5ID40PZvh4
43
+ 4nRtMSOdEJFt6EGLnNl+WCC/f9B/NXHKx2yTzXam52UEe0SDnDcDca3v4z54U2MY
44
+ v3qozFf8GSM1EFAcEHRDfCLj+/gXgOHK2DFcMc3YwGJUfiSbz2LfGzFG34nezJDA
45
+ TtRFdRlW4ctqUKA4CkGbbZlJ6v9WFAg72BD5OognB035vtpdvfLOiUfUeflskMTt
46
+ Uyci5s5sxw8TWRIpaXwk1pnLcivXC0TSVnzi1HhD6pNsejkBXBeQPxB6qMbWUhQb
47
+ RDzRqbe4z0/IjG6uAXhacXw087iPjPN7+xtZJWwCaQjWGuNn2Fs76CJRrWlt/DF9
48
+ PgaBlpul8EuNyMqZWKaehln0zBvH5Y177BXlrEeTpuUo5/kPWj2jEu51jfe+xIW8
49
+ 3RejLknCS39KjOV794ImLw8B1WlCwrfajVnXwgga8fCY6KGz7u3Prqq9irhRfycO
50
+ pAl7Rja/fb/1yBuQHrUU1lgYIXqb262lebMhLlDHntc+J8Vjk++UuP2WjPNeztp2
51
+ H4VF5NxMKJU8gScaN67FUtFYst5cz2aJuDHxbitFHKgoxNFYHVMjY26X/kmZVnUb
52
+ aNCsaa8YbPPUDmHf2rJjIlK+PZLvLlENFbWDxaRC7/ab39Za9DTD9zH4aut6gw3Y
53
+ q/eu/hnuc3qa580zbpgcAg==
54
+ -----END ENCRYPTED PRIVATE KEY-----
@@ -10,10 +10,12 @@ end
10
10
 
11
11
  describe "indexing with http_compression turned on", :integration => true do
12
12
  let(:event) { LogStash::Event.new("message" => "Hello World!", "type" => type) }
13
+ let(:event_with_invalid_utf_8_bytes) { LogStash::Event.new("message" => "Message from spacecraft which contains \xAC invalid \xD7 byte sequences.", "type" => type) }
13
14
  let(:index) { 10.times.collect { rand(10).to_s }.join("") }
14
15
  let(:type) { ESHelper.es_version_satisfies?("< 7") ? "doc" : "_doc" }
15
16
  let(:event_count) { 10000 + rand(500) }
16
- let(:events) { event_count.times.map { event }.to_a }
17
+ # mix the events with valid and invalid UTF-8 payloads
18
+ let(:events) { event_count.times.map { |i| i%3 == 0 ? event : event_with_invalid_utf_8_bytes }.to_a }
17
19
  let(:config) {
18
20
  {
19
21
  "hosts" => get_host_port,
@@ -46,7 +46,8 @@ describe "TARGET_BULK_BYTES", :integration => true do
46
46
  end
47
47
 
48
48
  describe "indexing" do
49
- let(:event) { LogStash::Event.new("message" => "Hello World!", "type" => type) }
49
+ let(:message) { "Hello from #{__FILE__}" }
50
+ let(:event) { LogStash::Event.new("message" => message, "type" => type) }
50
51
  let(:index) { 10.times.collect { rand(10).to_s }.join("") }
51
52
  let(:type) { ESHelper.es_version_satisfies?("< 7") ? "doc" : "_doc" }
52
53
  let(:event_count) { 1 + rand(2) }
@@ -55,10 +56,22 @@ describe "indexing" do
55
56
  subject { LogStash::Outputs::ElasticSearch.new(config) }
56
57
 
57
58
  let(:es_url) { "http://#{get_host_port}" }
58
- let(:index_url) {"#{es_url}/#{index}"}
59
- let(:http_client_options) { {} }
60
- let(:http_client) do
61
- Manticore::Client.new(http_client_options)
59
+ let(:index_url) { "#{es_url}/#{index}" }
60
+
61
+ let(:curl_opts) { nil }
62
+
63
+ def curl_and_get_json_response(url, method: :get); require 'open3'
64
+ begin
65
+ stdout, status = Open3.capture2("curl #{curl_opts} -X #{method.to_s.upcase} -k #{url}")
66
+ rescue Errno::ENOENT
67
+ fail "curl not available, make sure curl binary is installed and available on $PATH"
68
+ end
69
+
70
+ if status.success?
71
+ LogStash::Json.load(stdout)
72
+ else
73
+ fail "curl failed: #{status}\n #{stdout}"
74
+ end
62
75
  end
63
76
 
64
77
  before do
@@ -70,16 +83,16 @@ describe "indexing" do
70
83
  it "ships events" do
71
84
  subject.multi_receive(events)
72
85
 
73
- http_client.post("#{es_url}/_refresh").call
86
+ curl_and_get_json_response "#{es_url}/_refresh", method: :post
74
87
 
75
- response = http_client.get("#{index_url}/_count?q=*")
76
- result = LogStash::Json.load(response.body)
88
+ result = curl_and_get_json_response "#{index_url}/_count?q=*"
77
89
  cur_count = result["count"]
78
90
  expect(cur_count).to eq(event_count)
79
91
 
80
- response = http_client.get("#{index_url}/_search?q=*&size=1000")
81
- result = LogStash::Json.load(response.body)
92
+ result = curl_and_get_json_response "#{index_url}/_search?q=*&size=1000"
82
93
  result["hits"]["hits"].each do |doc|
94
+ expect(doc["_source"]["message"]).to eq(message)
95
+
83
96
  if ESHelper.es_version_satisfies?("< 8")
84
97
  expect(doc["_type"]).to eq(type)
85
98
  else
@@ -132,7 +145,7 @@ describe "indexing" do
132
145
  describe "a secured indexer", :secure_integration => true do
133
146
  let(:user) { "simpleuser" }
134
147
  let(:password) { "abc123" }
135
- let(:cacert) { "spec/fixtures/test_certs/test.crt" }
148
+ let(:cacert) { "spec/fixtures/test_certs/ca.crt" }
136
149
  let(:es_url) {"https://elasticsearch:9200"}
137
150
  let(:config) do
138
151
  {
@@ -140,42 +153,73 @@ describe "indexing" do
140
153
  "user" => user,
141
154
  "password" => password,
142
155
  "ssl" => true,
143
- "cacert" => "spec/fixtures/test_certs/test.crt",
156
+ "cacert" => cacert,
144
157
  "index" => index
145
158
  }
146
159
  end
147
- let(:http_client_options) do
148
- {
149
- :auth => {
150
- :user => user,
151
- :password => password
152
- },
153
- :ssl => {
154
- :enabled => true,
155
- :ca_file => cacert
156
- }
157
- }
158
- end
159
- it_behaves_like("an indexer", true)
160
-
161
- describe "with a password requiring escaping" do
162
- let(:user) { "f@ncyuser" }
163
- let(:password) { "ab%12#" }
164
-
165
- include_examples("an indexer", true)
166
- end
167
-
168
- describe "with a user/password requiring escaping in the URL" do
169
- let(:config) do
170
- {
171
- "hosts" => ["https://#{CGI.escape(user)}:#{CGI.escape(password)}@elasticsearch:9200"],
172
- "ssl" => true,
173
- "cacert" => "spec/fixtures/test_certs/test.crt",
174
- "index" => index
175
- }
160
+
161
+ let(:curl_opts) { "-u #{user}:#{password}" }
162
+
163
+ if ENV['ES_SSL_KEY_INVALID'] == 'true' # test_invalid.crt (configured in ES) has SAN: DNS:localhost
164
+ # javax.net.ssl.SSLPeerUnverifiedException: Host name 'elasticsearch' does not match the certificate subject ...
165
+
166
+ context "when no keystore nor ca cert set and verification is disabled" do
167
+ let(:config) do
168
+ super().tap { |config| config.delete('cacert') }.merge('ssl_certificate_verification' => false)
169
+ end
170
+
171
+ include_examples("an indexer", true)
172
+ end
173
+
174
+ context "when keystore is set and verification is disabled" do
175
+ let(:config) do
176
+ super().merge(
177
+ 'ssl_certificate_verification' => false,
178
+ 'keystore' => 'spec/fixtures/test_certs/test.p12',
179
+ 'keystore_password' => '1234567890'
180
+ )
181
+ end
182
+
183
+ include_examples("an indexer", true)
184
+ end
185
+
186
+ context "when keystore has self-signed cert and verification is disabled" do
187
+ let(:config) do
188
+ super().tap { |config| config.delete('cacert') }.merge(
189
+ 'ssl_certificate_verification' => false,
190
+ 'keystore' => 'spec/fixtures/test_certs/test_self_signed.p12',
191
+ 'keystore_password' => '1234567890'
192
+ )
193
+ end
194
+
195
+ include_examples("an indexer", true)
196
+ end
197
+
198
+ else
199
+
200
+ it_behaves_like("an indexer", true)
201
+
202
+ describe "with a password requiring escaping" do
203
+ let(:user) { "f@ncyuser" }
204
+ let(:password) { "ab%12#" }
205
+
206
+ include_examples("an indexer", true)
176
207
  end
177
-
178
- include_examples("an indexer", true)
208
+
209
+ describe "with a user/password requiring escaping in the URL" do
210
+ let(:config) do
211
+ {
212
+ "hosts" => ["https://#{CGI.escape(user)}:#{CGI.escape(password)}@elasticsearch:9200"],
213
+ "ssl" => true,
214
+ "cacert" => "spec/fixtures/test_certs/test.crt",
215
+ "index" => index
216
+ }
217
+ end
218
+
219
+ include_examples("an indexer", true)
220
+ end
221
+
179
222
  end
223
+
180
224
  end
181
225
  end
@@ -12,13 +12,13 @@ describe "elasticsearch is down on startup", :integration => true do
12
12
  "template_overwrite" => true,
13
13
  "hosts" => get_host_port(),
14
14
  "retry_max_interval" => 64,
15
- "retry_initial_interval" => 2
15
+ "retry_initial_interval" => 2,
16
+ 'ecs_compatibility' => 'disabled'
16
17
  })
17
18
  }
18
19
 
19
20
  before :each do
20
21
  # Delete all templates first.
21
- require "elasticsearch"
22
22
  allow(Stud).to receive(:stoppable_sleep)
23
23
 
24
24
  # Clean ES of data before we start.
@@ -33,7 +33,9 @@ describe "elasticsearch is down on startup", :integration => true do
33
33
  end
34
34
 
35
35
  it 'should ingest events when Elasticsearch recovers before documents are sent' do
36
- allow_any_instance_of(LogStash::Outputs::ElasticSearch::HttpClient::Pool).to receive(:get_es_version).and_raise(::LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError.new(StandardError.new, "big fail"))
36
+ allow_any_instance_of(LogStash::Outputs::ElasticSearch::HttpClient::Pool).to receive(:get_es_version).and_raise(
37
+ ::LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError.new StandardError.new("TEST: before docs are sent"), 'http://test.es/'
38
+ )
37
39
  subject.register
38
40
  allow_any_instance_of(LogStash::Outputs::ElasticSearch::HttpClient::Pool).to receive(:get_es_version).and_return(ESHelper.es_version)
39
41
  subject.multi_receive([event1, event2])
@@ -43,7 +45,9 @@ describe "elasticsearch is down on startup", :integration => true do
43
45
  end
44
46
 
45
47
  it 'should ingest events when Elasticsearch recovers after documents are sent' do
46
- allow_any_instance_of(LogStash::Outputs::ElasticSearch::HttpClient::Pool).to receive(:get_es_version).and_raise(::LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError.new(StandardError.new, "big fail"))
48
+ allow_any_instance_of(LogStash::Outputs::ElasticSearch::HttpClient::Pool).to receive(:get_es_version).and_raise(
49
+ ::LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError.new StandardError.new("TEST: after docs are sent"), 'http://test.es/'
50
+ )
47
51
  subject.register
48
52
  Thread.new do
49
53
  sleep 4
@@ -56,11 +60,13 @@ describe "elasticsearch is down on startup", :integration => true do
56
60
  end
57
61
 
58
62
  it 'should get cluster_uuid when Elasticsearch recovers from license check failure' do
59
- allow_any_instance_of(LogStash::Outputs::ElasticSearch::HttpClient::Pool).to receive(:get_license).with(instance_of(LogStash::Util::SafeURI)).and_raise(::LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError.new(StandardError.new, "big fail"))
63
+ allow_any_instance_of(LogStash::Outputs::ElasticSearch::HttpClient::Pool).to receive(:get_license).and_raise(
64
+ ::LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError.new StandardError.new("TEST: docs are sent"), 'http://test.es/_license'
65
+ )
60
66
  subject.register
61
67
  Thread.new do
62
68
  sleep 4
63
- allow_any_instance_of(LogStash::Outputs::ElasticSearch::HttpClient::Pool).to receive(:get_license).with(instance_of(LogStash::Util::SafeURI)).and_call_original
69
+ allow_any_instance_of(LogStash::Outputs::ElasticSearch::HttpClient::Pool).to receive(:get_license).and_call_original
64
70
  end
65
71
  subject.multi_receive([event1, event2])
66
72
  @es.indices.refresh
@@ -243,12 +243,14 @@ describe LogStash::Outputs::ElasticSearch::HttpClient do
243
243
  end
244
244
  end
245
245
 
246
- context "with two messages" do
247
- let(:message1) { "hey" }
248
- let(:message2) { "you" }
246
+ context "with multiple messages" do
247
+ let(:message_head) { "Spacecraft message" }
248
+ let(:message_tail) { "byte sequence" }
249
+ let(:invalid_utf_8_message) { "contains invalid \xAC" }
249
250
  let(:actions) { [
250
- ["index", {:_id=>nil, :_index=>"logstash"}, {"message"=> message1}],
251
- ["index", {:_id=>nil, :_index=>"logstash"}, {"message"=> message2}],
251
+ ["index", {:_id=>nil, :_index=>"logstash"}, {"message"=> message_head}],
252
+ ["index", {:_id=>nil, :_index=>"logstash"}, {"message"=> invalid_utf_8_message}],
253
+ ["index", {:_id=>nil, :_index=>"logstash"}, {"message"=> message_tail}],
252
254
  ]}
253
255
  it "executes one bulk_send operation" do
254
256
  allow(subject).to receive(:join_bulk_responses)
@@ -258,7 +260,7 @@ describe LogStash::Outputs::ElasticSearch::HttpClient do
258
260
 
259
261
  context "if one exceeds TARGET_BULK_BYTES" do
260
262
  let(:target_bulk_bytes) { LogStash::Outputs::ElasticSearch::TARGET_BULK_BYTES }
261
- let(:message1) { "a" * (target_bulk_bytes + 1) }
263
+ let(:message_head) { "a" * (target_bulk_bytes + 1) }
262
264
  it "executes two bulk_send operations" do
263
265
  allow(subject).to receive(:join_bulk_responses)
264
266
  expect(subject).to receive(:bulk_send).twice
@@ -33,7 +33,7 @@ describe "SSL option" do
33
33
 
34
34
  it "should pass the flag to the ES client" do
35
35
  expect(::Manticore::Client).to receive(:new) do |args|
36
- expect(args[:ssl]).to eq(:enabled => true, :verify => false)
36
+ expect(args[:ssl]).to eq(:enabled => true, :verify => :disable)
37
37
  end.and_return(manticore_double)
38
38
 
39
39
  subject.register
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.4.0
4
+ version: 11.4.2
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-13 00:00:00.000000000 Z
11
+ date: 2024-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 0.7.1
18
+ version: 0.8.0
19
19
  - - "<"
20
20
  - !ruby/object:Gem::Version
21
21
  version: 1.0.0
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.7.1
29
+ version: 0.8.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.0.0
@@ -244,10 +244,18 @@ files:
244
244
  - spec/fixtures/template-with-policy-es6x.json
245
245
  - spec/fixtures/template-with-policy-es7x.json
246
246
  - spec/fixtures/template-with-policy-es8x.json
247
- - spec/fixtures/test_certs/ca/ca.crt
248
- - spec/fixtures/test_certs/ca/ca.key
247
+ - spec/fixtures/test_certs/ca.crt
248
+ - spec/fixtures/test_certs/ca.key
249
+ - spec/fixtures/test_certs/renew.sh
249
250
  - spec/fixtures/test_certs/test.crt
250
251
  - spec/fixtures/test_certs/test.key
252
+ - spec/fixtures/test_certs/test.p12
253
+ - spec/fixtures/test_certs/test_invalid.crt
254
+ - spec/fixtures/test_certs/test_invalid.key
255
+ - spec/fixtures/test_certs/test_invalid.p12
256
+ - spec/fixtures/test_certs/test_self_signed.crt
257
+ - spec/fixtures/test_certs/test_self_signed.key
258
+ - spec/fixtures/test_certs/test_self_signed.p12
251
259
  - spec/integration/outputs/compressed_indexing_spec.rb
252
260
  - spec/integration/outputs/create_spec.rb
253
261
  - spec/integration/outputs/data_stream_spec.rb
@@ -319,10 +327,18 @@ test_files:
319
327
  - spec/fixtures/template-with-policy-es6x.json
320
328
  - spec/fixtures/template-with-policy-es7x.json
321
329
  - spec/fixtures/template-with-policy-es8x.json
322
- - spec/fixtures/test_certs/ca/ca.crt
323
- - spec/fixtures/test_certs/ca/ca.key
330
+ - spec/fixtures/test_certs/ca.crt
331
+ - spec/fixtures/test_certs/ca.key
332
+ - spec/fixtures/test_certs/renew.sh
324
333
  - spec/fixtures/test_certs/test.crt
325
334
  - spec/fixtures/test_certs/test.key
335
+ - spec/fixtures/test_certs/test.p12
336
+ - spec/fixtures/test_certs/test_invalid.crt
337
+ - spec/fixtures/test_certs/test_invalid.key
338
+ - spec/fixtures/test_certs/test_invalid.p12
339
+ - spec/fixtures/test_certs/test_self_signed.crt
340
+ - spec/fixtures/test_certs/test_self_signed.key
341
+ - spec/fixtures/test_certs/test_self_signed.p12
326
342
  - spec/integration/outputs/compressed_indexing_spec.rb
327
343
  - spec/integration/outputs/create_spec.rb
328
344
  - spec/integration/outputs/data_stream_spec.rb
@@ -1,32 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
31
- nIg9fQPvVw+fIHACZQ==
32
- -----END CERTIFICATE-----
File without changes