logstash-output-elasticsearch 11.22.9-java → 12.0.0-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 +4 -4
- data/CHANGELOG.md +15 -0
- data/docs/index.asciidoc +18 -90
- data/lib/logstash/outputs/elasticsearch/http_client/manticore_adapter.rb +1 -1
- data/lib/logstash/outputs/elasticsearch.rb +0 -47
- data/lib/logstash/plugin_mixins/elasticsearch/api_configs.rb +12 -28
- data/logstash-output-elasticsearch.gemspec +1 -1
- data/spec/integration/outputs/compressed_indexing_spec.rb +8 -1
- data/spec/integration/outputs/index_spec.rb +5 -2
- data/spec/unit/outputs/elasticsearch/http_client/manticore_adapter_spec.rb +1 -1
- data/spec/unit/outputs/elasticsearch_spec.rb +0 -75
- data/spec/unit/outputs/elasticsearch_ssl_spec.rb +22 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 983d99de3a0dcd5e58fb123e01ad8ee4c2396ce15fd565dda439e43c182b32e6
|
|
4
|
+
data.tar.gz: 8733e1a9b256b36e9f08a9be0803ca667817d7fe9f1e4cd1e090fe95882eb245
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f9626da6b7d428b17a16b2874a8758e260e84af265636fabea8e35dec0777ecdeae1b662910d2e065eccc4742ef706765d87b6cf475a141544a78347c69953de
|
|
7
|
+
data.tar.gz: 7997cfb3b851130a0504c0907761aba37ea31ec35deb7fc4de19eaf7f1ae00cee9df7b2575d59ace2b08c19ad7710460c534467bb79f7019c3a125478d0de5e2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## 12.0.0
|
|
2
|
+
- SSL settings that were marked deprecated in version `11.14.0` are now marked obsolete, and will prevent the plugin from starting.
|
|
3
|
+
- These settings are:
|
|
4
|
+
- `cacert`, which should be replaced by `ssl_certificate_authorities`
|
|
5
|
+
- `keystore`, which should be replaced by `ssl_keystore_path`
|
|
6
|
+
- `keystore_password`, which should be replaced by `ssl_keystore_password`
|
|
7
|
+
- `ssl`, which should be replaced by `ssl_enabled`
|
|
8
|
+
- `ssl_certificate_verification`, which should be replaced by `ssl_verification_mode`
|
|
9
|
+
- `truststore`, which should be replaced by `ssl_truststore_path`
|
|
10
|
+
- `truststore_password`, which should be replaced by `ssl_truststore_password`
|
|
11
|
+
- [#1197](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1197)
|
|
12
|
+
|
|
13
|
+
## 11.22.10
|
|
14
|
+
- Add `x-elastic-product-origin` header to Elasticsearch requests [#1195](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1195)
|
|
15
|
+
|
|
1
16
|
## 11.22.9
|
|
2
17
|
- Vendor ECS template for Elasticsearch 9.x in built gem [#1188](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1188)
|
|
3
18
|
|
data/docs/index.asciidoc
CHANGED
|
@@ -325,8 +325,10 @@ When a string value on an event contains one or more byte sequences that are not
|
|
|
325
325
|
[id="plugins-{type}s-{plugin}-options"]
|
|
326
326
|
==== Elasticsearch Output Configuration Options
|
|
327
327
|
|
|
328
|
-
This plugin supports
|
|
329
|
-
|
|
328
|
+
This plugin supports these configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
|
|
329
|
+
|
|
330
|
+
NOTE: As of version 12.0.0 of this plugin, a number of previously deprecated SSL settings have been removed.
|
|
331
|
+
Please check out <<plugins-{type}s-{plugin}-obsolete-options>> for details.
|
|
330
332
|
|
|
331
333
|
[cols="<,<,<",options="header",]
|
|
332
334
|
|=======================================================================
|
|
@@ -441,7 +443,7 @@ For more details on actions, check out the {ref}/docs-bulk.html[Elasticsearch bu
|
|
|
441
443
|
* There is no default value for this setting.
|
|
442
444
|
|
|
443
445
|
Authenticate using Elasticsearch API key.
|
|
444
|
-
Note that this option also requires SSL/TLS, which can be enabled by supplying a <<plugins-{type}s-{plugin}-cloud_id>>, a list of HTTPS <<plugins-{type}s-{plugin}-hosts>>, or by setting <<plugins-{type}s-{plugin}-
|
|
446
|
+
Note that this option also requires SSL/TLS, which can be enabled by supplying a <<plugins-{type}s-{plugin}-cloud_id>>, a list of HTTPS <<plugins-{type}s-{plugin}-hosts>>, or by setting <<plugins-{type}s-{plugin}-ssl_enabled,`ssl_enabled => true`>>.
|
|
445
447
|
|
|
446
448
|
Format is `id:api_key` where `id` and `api_key` are as returned by the
|
|
447
449
|
Elasticsearch {ref}/security-api-create-api-key.html[Create API key API].
|
|
@@ -1324,98 +1326,24 @@ https://www.elastic.co/blog/elasticsearch-versioning-support[versioning support
|
|
|
1324
1326
|
blog] and {ref}/docs-index_.html#_version_types[Version types] in the
|
|
1325
1327
|
Elasticsearch documentation.
|
|
1326
1328
|
|
|
1327
|
-
[id="plugins-{type}s-{plugin}-
|
|
1328
|
-
==== Elasticsearch Output
|
|
1329
|
-
|
|
1330
|
-
This plugin supports the following deprecated configurations.
|
|
1329
|
+
[id="plugins-{type}s-{plugin}-obsolete-options"]
|
|
1330
|
+
==== Elasticsearch Output Obsolete Configuration Options
|
|
1331
1331
|
|
|
1332
|
-
WARNING:
|
|
1332
|
+
WARNING: As of version `12.0.0` of this plugin, some configuration options have been replaced.
|
|
1333
|
+
The plugin will fail to start if it contains any of these obsolete options.
|
|
1333
1334
|
|
|
1334
|
-
[cols="
|
|
1335
|
+
[cols="<,<",options="header",]
|
|
1335
1336
|
|=======================================================================
|
|
1336
|
-
|Setting|
|
|
1337
|
-
|
|
|
1338
|
-
|
|
|
1339
|
-
|
|
|
1340
|
-
|
|
|
1341
|
-
|
|
|
1342
|
-
|
|
|
1343
|
-
|
|
|
1337
|
+
|Setting|Replaced by
|
|
1338
|
+
| cacert | <<plugins-{type}s-{plugin}-ssl_certificate_authorities>>
|
|
1339
|
+
| keystore | <<plugins-{type}s-{plugin}-ssl_keystore_path>>
|
|
1340
|
+
| keystore_password | <<plugins-{type}s-{plugin}-ssl_keystore_password>>
|
|
1341
|
+
| ssl | <<plugins-{type}s-{plugin}-ssl_enabled>>
|
|
1342
|
+
| ssl_certificate_verification | <<plugins-{type}s-{plugin}-ssl_verification_mode>>
|
|
1343
|
+
| truststore | <<plugins-{type}s-{plugin}-ssl_truststore_path>>
|
|
1344
|
+
| truststore_password | <<plugins-{type}s-{plugin}-ssl_truststore_password>>
|
|
1344
1345
|
|=======================================================================
|
|
1345
1346
|
|
|
1346
|
-
|
|
1347
|
-
[id="plugins-{type}s-{plugin}-cacert"]
|
|
1348
|
-
===== `cacert`
|
|
1349
|
-
deprecated[11.14.0, Replaced by <<plugins-{type}s-{plugin}-ssl_certificate_authorities>>]
|
|
1350
|
-
|
|
1351
|
-
* Value type is a list of <<path,path>>
|
|
1352
|
-
* There is no default value for this setting.
|
|
1353
|
-
|
|
1354
|
-
The .cer or .pem file to validate the server's certificate.
|
|
1355
|
-
|
|
1356
|
-
[id="plugins-{type}s-{plugin}-keystore"]
|
|
1357
|
-
===== `keystore`
|
|
1358
|
-
deprecated[11.14.0, Replaced by <<plugins-{type}s-{plugin}-ssl_keystore_path>>]
|
|
1359
|
-
|
|
1360
|
-
* Value type is <<path,path>>
|
|
1361
|
-
* There is no default value for this setting.
|
|
1362
|
-
|
|
1363
|
-
The keystore used to present a certificate to the server.
|
|
1364
|
-
It can be either .jks or .p12
|
|
1365
|
-
|
|
1366
|
-
NOTE: You cannot use this setting and <<plugins-{type}s-{plugin}-ssl_certificate>> at the same time.
|
|
1367
|
-
|
|
1368
|
-
[id="plugins-{type}s-{plugin}-keystore_password"]
|
|
1369
|
-
===== `keystore_password`
|
|
1370
|
-
deprecated[11.14.0, Replaced by <<plugins-{type}s-{plugin}-ssl_keystore_password>>]
|
|
1371
|
-
|
|
1372
|
-
* Value type is <<password,password>>
|
|
1373
|
-
* There is no default value for this setting.
|
|
1374
|
-
|
|
1375
|
-
Set the keystore password
|
|
1376
|
-
|
|
1377
|
-
[id="plugins-{type}s-{plugin}-ssl"]
|
|
1378
|
-
===== `ssl`
|
|
1379
|
-
deprecated[11.14.0, Replaced by <<plugins-{type}s-{plugin}-ssl_enabled>>]
|
|
1380
|
-
|
|
1381
|
-
* Value type is <<boolean,boolean>>
|
|
1382
|
-
* There is no default value for this setting.
|
|
1383
|
-
|
|
1384
|
-
Enable SSL/TLS secured communication to Elasticsearch cluster.
|
|
1385
|
-
Leaving this unspecified will use whatever scheme is specified in the URLs listed in <<plugins-{type}s-{plugin}-hosts>> or extracted from the <<plugins-{type}s-{plugin}-cloud_id>>.
|
|
1386
|
-
If no explicit protocol is specified plain HTTP will be used.
|
|
1387
|
-
|
|
1388
|
-
[id="plugins-{type}s-{plugin}-ssl_certificate_verification"]
|
|
1389
|
-
===== `ssl_certificate_verification`
|
|
1390
|
-
deprecated[11.14.0, Replaced by <<plugins-{type}s-{plugin}-ssl_verification_mode>>]
|
|
1391
|
-
|
|
1392
|
-
* Value type is <<boolean,boolean>>
|
|
1393
|
-
* Default value is `true`
|
|
1394
|
-
|
|
1395
|
-
Option to validate the server's certificate. Disabling this severely compromises security.
|
|
1396
|
-
For more information on disabling certificate verification please read
|
|
1397
|
-
https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf
|
|
1398
|
-
|
|
1399
|
-
[id="plugins-{type}s-{plugin}-truststore"]
|
|
1400
|
-
===== `truststore`
|
|
1401
|
-
deprecated[11.14.0, Replaced by <<plugins-{type}s-{plugin}-ssl_truststore_path>>]
|
|
1402
|
-
|
|
1403
|
-
* Value type is <<path,path>>
|
|
1404
|
-
* There is no default value for this setting.
|
|
1405
|
-
|
|
1406
|
-
The truststore to validate the server's certificate.
|
|
1407
|
-
It can be either `.jks` or `.p12`.
|
|
1408
|
-
Use either `:truststore` or `:cacert`.
|
|
1409
|
-
|
|
1410
|
-
[id="plugins-{type}s-{plugin}-truststore_password"]
|
|
1411
|
-
===== `truststore_password`
|
|
1412
|
-
deprecated[11.14.0, Replaced by <<plugins-{type}s-{plugin}-ssl_truststore_password>>]
|
|
1413
|
-
|
|
1414
|
-
* Value type is <<password,password>>
|
|
1415
|
-
* There is no default value for this setting.
|
|
1416
|
-
|
|
1417
|
-
Set the truststore password
|
|
1418
|
-
|
|
1419
1347
|
[id="plugins-{type}s-{plugin}-common-options"]
|
|
1420
1348
|
include::{include_path}/{type}.asciidoc[]
|
|
1421
1349
|
|
|
@@ -2,7 +2,7 @@ require 'manticore'
|
|
|
2
2
|
require 'cgi'
|
|
3
3
|
|
|
4
4
|
module LogStash; module Outputs; class ElasticSearch; class HttpClient;
|
|
5
|
-
DEFAULT_HEADERS = { "Content-Type" => "application/json" }
|
|
5
|
+
DEFAULT_HEADERS = { "Content-Type" => "application/json", 'x-elastic-product-origin' => 'logstash-output-elasticsearch' }
|
|
6
6
|
|
|
7
7
|
class ManticoreAdapter
|
|
8
8
|
attr_reader :manticore, :logger
|
|
@@ -275,7 +275,6 @@ class LogStash::Outputs::ElasticSearch < LogStash::Outputs::Base
|
|
|
275
275
|
def initialize(*params)
|
|
276
276
|
super
|
|
277
277
|
setup_ecs_compatibility_related_defaults
|
|
278
|
-
setup_ssl_params!
|
|
279
278
|
setup_compression_level!
|
|
280
279
|
end
|
|
281
280
|
|
|
@@ -694,52 +693,6 @@ class LogStash::Outputs::ElasticSearch < LogStash::Outputs::Base
|
|
|
694
693
|
end
|
|
695
694
|
end
|
|
696
695
|
|
|
697
|
-
def setup_ssl_params!
|
|
698
|
-
@ssl_enabled = normalize_config(:ssl_enabled) do |normalize|
|
|
699
|
-
normalize.with_deprecated_alias(:ssl)
|
|
700
|
-
end
|
|
701
|
-
|
|
702
|
-
@ssl_certificate_authorities = normalize_config(:ssl_certificate_authorities) do |normalize|
|
|
703
|
-
normalize.with_deprecated_mapping(:cacert) do |cacert|
|
|
704
|
-
[cacert]
|
|
705
|
-
end
|
|
706
|
-
end
|
|
707
|
-
|
|
708
|
-
@ssl_keystore_path = normalize_config(:ssl_keystore_path) do |normalize|
|
|
709
|
-
normalize.with_deprecated_alias(:keystore)
|
|
710
|
-
end
|
|
711
|
-
|
|
712
|
-
@ssl_keystore_password = normalize_config(:ssl_keystore_password) do |normalize|
|
|
713
|
-
normalize.with_deprecated_alias(:keystore_password)
|
|
714
|
-
end
|
|
715
|
-
|
|
716
|
-
@ssl_truststore_path = normalize_config(:ssl_truststore_path) do |normalize|
|
|
717
|
-
normalize.with_deprecated_alias(:truststore)
|
|
718
|
-
end
|
|
719
|
-
|
|
720
|
-
@ssl_truststore_password = normalize_config(:ssl_truststore_password) do |normalize|
|
|
721
|
-
normalize.with_deprecated_alias(:truststore_password)
|
|
722
|
-
end
|
|
723
|
-
|
|
724
|
-
@ssl_verification_mode = normalize_config(:ssl_verification_mode) do |normalize|
|
|
725
|
-
normalize.with_deprecated_mapping(:ssl_certificate_verification) do |ssl_certificate_verification|
|
|
726
|
-
if ssl_certificate_verification == true
|
|
727
|
-
"full"
|
|
728
|
-
else
|
|
729
|
-
"none"
|
|
730
|
-
end
|
|
731
|
-
end
|
|
732
|
-
end
|
|
733
|
-
|
|
734
|
-
params['ssl_enabled'] = @ssl_enabled unless @ssl_enabled.nil?
|
|
735
|
-
params['ssl_certificate_authorities'] = @ssl_certificate_authorities unless @ssl_certificate_authorities.nil?
|
|
736
|
-
params['ssl_keystore_path'] = @ssl_keystore_path unless @ssl_keystore_path.nil?
|
|
737
|
-
params['ssl_keystore_password'] = @ssl_keystore_password unless @ssl_keystore_password.nil?
|
|
738
|
-
params['ssl_truststore_path'] = @ssl_truststore_path unless @ssl_truststore_path.nil?
|
|
739
|
-
params['ssl_truststore_password'] = @ssl_truststore_password unless @ssl_truststore_password.nil?
|
|
740
|
-
params['ssl_verification_mode'] = @ssl_verification_mode unless @ssl_verification_mode.nil?
|
|
741
|
-
end
|
|
742
|
-
|
|
743
696
|
def setup_compression_level!
|
|
744
697
|
@compression_level = normalize_config(:compression_level) do |normalize|
|
|
745
698
|
normalize.with_deprecated_mapping(:http_compression) do |http_compression|
|
|
@@ -43,40 +43,23 @@ module LogStash; module PluginMixins; module ElasticSearch
|
|
|
43
43
|
# urls that already have query strings, the one specified here will be appended.
|
|
44
44
|
:parameters => { :validate => :hash },
|
|
45
45
|
|
|
46
|
-
# Enable SSL/TLS secured communication to Elasticsearch cluster. Leaving this unspecified will use whatever scheme
|
|
47
|
-
# is specified in the URLs listed in 'hosts'. If no explicit protocol is specified plain HTTP will be used.
|
|
48
|
-
# If SSL is explicitly disabled here the plugin will refuse to start if an HTTPS URL is given in 'hosts'
|
|
49
|
-
:ssl => { :validate => :boolean, :deprecated => "Set 'ssl_enabled' instead." },
|
|
50
|
-
|
|
51
46
|
# Enable SSL/TLS secured communication to Elasticsearch cluster. Leaving this unspecified will use whatever scheme
|
|
52
47
|
# is specified in the URLs listed in 'hosts'. If no explicit protocol is specified plain HTTP will be used.
|
|
53
48
|
# If SSL is explicitly disabled here the plugin will refuse to start if an HTTPS URL is given in 'hosts'
|
|
54
49
|
:ssl_enabled => { :validate => :boolean },
|
|
55
50
|
|
|
56
|
-
# Option to validate the server's certificate. Disabling this severely compromises security.
|
|
57
|
-
# For more information on disabling certificate verification please read
|
|
58
|
-
# https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf
|
|
59
|
-
:ssl_certificate_verification => { :validate => :boolean, :default => true, :deprecated => "Set 'ssl_verification_mode' instead." },
|
|
60
|
-
|
|
61
51
|
# Options to verify the server's certificate.
|
|
62
52
|
# "full": validates that the provided certificate has an issue date that’s within the not_before and not_after dates;
|
|
63
53
|
# chains to a trusted Certificate Authority (CA); has a hostname or IP address that matches the names within the certificate.
|
|
64
54
|
# "none": performs no certificate validation. Disabling this severely compromises security (https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf)
|
|
65
55
|
:ssl_verification_mode => { :validate => %w[full none], :default => 'full' },
|
|
66
56
|
|
|
67
|
-
# The .cer or .pem file to validate the server's certificate
|
|
68
|
-
:cacert => { :validate => :path, :deprecated => "Set 'ssl_certificate_authorities' instead." },
|
|
69
|
-
|
|
70
57
|
# The .cer or .pem files to validate the server's certificate
|
|
71
58
|
:ssl_certificate_authorities => { :validate => :path, :list => true },
|
|
72
59
|
|
|
73
60
|
# One or more hex-encoded SHA256 fingerprints to trust as Certificate Authorities
|
|
74
61
|
:ca_trusted_fingerprint => LogStash::PluginMixins::CATrustedFingerprintSupport,
|
|
75
62
|
|
|
76
|
-
# The JKS truststore to validate the server's certificate.
|
|
77
|
-
# Use either `:truststore` or `:cacert`
|
|
78
|
-
:truststore => { :validate => :path, :deprecated => "Set 'ssl_truststore_path' instead." },
|
|
79
|
-
|
|
80
63
|
# The JKS truststore to validate the server's certificate.
|
|
81
64
|
# Use either `:ssl_truststore_path` or `:ssl_certificate_authorities`
|
|
82
65
|
:ssl_truststore_path => { :validate => :path },
|
|
@@ -84,16 +67,9 @@ module LogStash; module PluginMixins; module ElasticSearch
|
|
|
84
67
|
# The format of the truststore file. It must be either jks or pkcs12
|
|
85
68
|
:ssl_truststore_type => { :validate => %w[pkcs12 jks] },
|
|
86
69
|
|
|
87
|
-
# Set the truststore password
|
|
88
|
-
:truststore_password => { :validate => :password, :deprecated => "Use 'ssl_truststore_password' instead." },
|
|
89
|
-
|
|
90
70
|
# Set the truststore password
|
|
91
71
|
:ssl_truststore_password => { :validate => :password },
|
|
92
72
|
|
|
93
|
-
# The keystore used to present a certificate to the server.
|
|
94
|
-
# It can be either .jks or .p12
|
|
95
|
-
:keystore => { :validate => :path, :deprecated => "Set 'ssl_keystore_path' instead." },
|
|
96
|
-
|
|
97
73
|
# The keystore used to present a certificate to the server.
|
|
98
74
|
# It can be either .jks or .p12
|
|
99
75
|
:ssl_keystore_path => { :validate => :path },
|
|
@@ -101,9 +77,6 @@ module LogStash; module PluginMixins; module ElasticSearch
|
|
|
101
77
|
# The format of the keystore file. It must be either jks or pkcs12
|
|
102
78
|
:ssl_keystore_type => { :validate => %w[pkcs12 jks] },
|
|
103
79
|
|
|
104
|
-
# Set the keystore password
|
|
105
|
-
:keystore_password => { :validate => :password, :deprecated => "Set 'ssl_keystore_password' instead." },
|
|
106
|
-
|
|
107
80
|
# Set the keystore password
|
|
108
81
|
:ssl_keystore_password => { :validate => :password },
|
|
109
82
|
|
|
@@ -229,7 +202,17 @@ module LogStash; module PluginMixins; module ElasticSearch
|
|
|
229
202
|
:dlq_custom_codes => { :validate => :number, :list => true, :default => [] },
|
|
230
203
|
|
|
231
204
|
# if enabled, failed index name interpolation events go into dead letter queue.
|
|
232
|
-
:dlq_on_failed_indexname_interpolation => { :validate => :boolean, :default => true }
|
|
205
|
+
:dlq_on_failed_indexname_interpolation => { :validate => :boolean, :default => true },
|
|
206
|
+
|
|
207
|
+
# Obsolete Settings
|
|
208
|
+
:ssl => { :obsolete => "Set 'ssl_enabled' instead." },
|
|
209
|
+
:ssl_certificate_verification => { :obsolete => "Set 'ssl_verification_mode' instead." },
|
|
210
|
+
:cacert => { :obsolete => "Set 'ssl_certificate_authorities' instead." },
|
|
211
|
+
:truststore => { :obsolete => "Set 'ssl_truststore_path' instead." },
|
|
212
|
+
:keystore => { :obsolete => "Set 'ssl_keystore_path' instead." },
|
|
213
|
+
# Leave :validate to ensure obfuscation of sensitive setting for passwords
|
|
214
|
+
:truststore_password => { :validate => :password, :obsolete => "Use 'ssl_truststore_password' instead." },
|
|
215
|
+
:keystore_password => { :validate => :password, :obsolete => "Set 'ssl_keystore_password' instead." }
|
|
233
216
|
}.freeze
|
|
234
217
|
|
|
235
218
|
def self.included(base)
|
|
@@ -243,3 +226,4 @@ module LogStash; module PluginMixins; module ElasticSearch
|
|
|
243
226
|
end
|
|
244
227
|
end
|
|
245
228
|
end; end; end
|
|
229
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'logstash-output-elasticsearch'
|
|
3
|
-
s.version = '
|
|
3
|
+
s.version = '12.0.0'
|
|
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"
|
|
@@ -32,6 +32,13 @@ end
|
|
|
32
32
|
let(:http_client) do
|
|
33
33
|
Manticore::Client.new(http_client_options)
|
|
34
34
|
end
|
|
35
|
+
let(:expected_headers) {
|
|
36
|
+
{
|
|
37
|
+
"Content-Encoding" => "gzip",
|
|
38
|
+
"Content-Type" => "application/json",
|
|
39
|
+
'x-elastic-product-origin' => 'logstash-output-elasticsearch'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
35
42
|
|
|
36
43
|
before do
|
|
37
44
|
subject.register
|
|
@@ -64,7 +71,7 @@ end
|
|
|
64
71
|
|
|
65
72
|
it "sets the correct content-encoding header and body is compressed" do
|
|
66
73
|
expect(subject.client.pool.adapter.client).to receive(:send).
|
|
67
|
-
with(anything, anything, {:headers=>
|
|
74
|
+
with(anything, anything, {:headers=> expected_headers, :body => a_valid_gzip_encoded_string}).
|
|
68
75
|
and_call_original
|
|
69
76
|
subject.multi_receive(events)
|
|
70
77
|
end
|
|
@@ -214,10 +214,13 @@ describe "indexing" do
|
|
|
214
214
|
end
|
|
215
215
|
|
|
216
216
|
it "sets the correct content-type header" do
|
|
217
|
-
expected_manticore_opts = {
|
|
217
|
+
expected_manticore_opts = {
|
|
218
|
+
:headers => {"Content-Type" => "application/json", 'x-elastic-product-origin' => 'logstash-output-elasticsearch'},
|
|
219
|
+
:body => anything
|
|
220
|
+
}
|
|
218
221
|
if secure
|
|
219
222
|
expected_manticore_opts = {
|
|
220
|
-
:headers => {"Content-Type" => "application/json"},
|
|
223
|
+
:headers => {"Content-Type" => "application/json", 'x-elastic-product-origin' => 'logstash-output-elasticsearch'},
|
|
221
224
|
:body => anything,
|
|
222
225
|
:auth => {
|
|
223
226
|
:user => user,
|
|
@@ -34,7 +34,7 @@ describe LogStash::Outputs::ElasticSearch::HttpClient::ManticoreAdapter do
|
|
|
34
34
|
|
|
35
35
|
expect(subject.manticore).to receive(:get).
|
|
36
36
|
with(expected_uri.to_s, {
|
|
37
|
-
:headers =>
|
|
37
|
+
:headers => LogStash::Outputs::ElasticSearch::HttpClient::DEFAULT_HEADERS,
|
|
38
38
|
:auth => {
|
|
39
39
|
:user => user,
|
|
40
40
|
:password => password,
|
|
@@ -1125,81 +1125,6 @@ describe LogStash::Outputs::ElasticSearch do
|
|
|
1125
1125
|
end
|
|
1126
1126
|
end
|
|
1127
1127
|
|
|
1128
|
-
describe "SSL deprecated settings" do
|
|
1129
|
-
let(:base_options) { {"ssl" => "true"} }
|
|
1130
|
-
|
|
1131
|
-
context "with client certificate" do
|
|
1132
|
-
let(:do_register) { true }
|
|
1133
|
-
let(:cacert) { Stud::Temporary.file.path }
|
|
1134
|
-
let(:options) { base_options.merge(
|
|
1135
|
-
"cacert" => cacert,
|
|
1136
|
-
"ssl_certificate_verification" => false
|
|
1137
|
-
) }
|
|
1138
|
-
|
|
1139
|
-
after :each do
|
|
1140
|
-
File.delete(cacert)
|
|
1141
|
-
end
|
|
1142
|
-
|
|
1143
|
-
it "should map new configs into params" do
|
|
1144
|
-
expect(subject.params).to match hash_including(
|
|
1145
|
-
"ssl_enabled" => true,
|
|
1146
|
-
"ssl_verification_mode" => "none",
|
|
1147
|
-
"ssl_certificate_authorities" => [cacert]
|
|
1148
|
-
)
|
|
1149
|
-
end
|
|
1150
|
-
|
|
1151
|
-
it "should set new configs variables" do
|
|
1152
|
-
expect(subject.instance_variable_get(:@ssl_enabled)).to eql(true)
|
|
1153
|
-
expect(subject.instance_variable_get(:@ssl_verification_mode)).to eql("none")
|
|
1154
|
-
expect(subject.instance_variable_get(:@ssl_certificate_authorities)).to eql([cacert])
|
|
1155
|
-
end
|
|
1156
|
-
end
|
|
1157
|
-
|
|
1158
|
-
context "with java stores" do
|
|
1159
|
-
let(:do_register) { true }
|
|
1160
|
-
let(:keystore) { Stud::Temporary.file.path }
|
|
1161
|
-
let(:truststore) { Stud::Temporary.file.path }
|
|
1162
|
-
let(:options) { base_options.merge(
|
|
1163
|
-
"keystore" => keystore,
|
|
1164
|
-
"keystore_password" => "keystore",
|
|
1165
|
-
"truststore" => truststore,
|
|
1166
|
-
"truststore_password" => "truststore",
|
|
1167
|
-
"ssl_certificate_verification" => true
|
|
1168
|
-
) }
|
|
1169
|
-
|
|
1170
|
-
let(:spy_http_client_builder!) do
|
|
1171
|
-
allow(described_class::HttpClientBuilder).to receive(:build).with(any_args).and_call_original
|
|
1172
|
-
allow(described_class::HttpClientBuilder).to receive(:setup_ssl).with(any_args).and_return({})
|
|
1173
|
-
end
|
|
1174
|
-
|
|
1175
|
-
after :each do
|
|
1176
|
-
File.delete(keystore)
|
|
1177
|
-
File.delete(truststore)
|
|
1178
|
-
end
|
|
1179
|
-
|
|
1180
|
-
it "should map new configs into params" do
|
|
1181
|
-
expect(subject.params).to match hash_including(
|
|
1182
|
-
"ssl_enabled" => true,
|
|
1183
|
-
"ssl_keystore_path" => keystore,
|
|
1184
|
-
"ssl_truststore_path" => truststore,
|
|
1185
|
-
"ssl_verification_mode" => "full"
|
|
1186
|
-
)
|
|
1187
|
-
|
|
1188
|
-
expect(subject.params["ssl_keystore_password"].value).to eql("keystore")
|
|
1189
|
-
expect(subject.params["ssl_truststore_password"].value).to eql("truststore")
|
|
1190
|
-
end
|
|
1191
|
-
|
|
1192
|
-
it "should set new configs variables" do
|
|
1193
|
-
expect(subject.instance_variable_get(:@ssl_enabled)).to eql(true)
|
|
1194
|
-
expect(subject.instance_variable_get(:@ssl_keystore_path)).to eql(keystore)
|
|
1195
|
-
expect(subject.instance_variable_get(:@ssl_keystore_password).value).to eql("keystore")
|
|
1196
|
-
expect(subject.instance_variable_get(:@ssl_truststore_path)).to eql(truststore)
|
|
1197
|
-
expect(subject.instance_variable_get(:@ssl_truststore_password).value).to eql("truststore")
|
|
1198
|
-
expect(subject.instance_variable_get(:@ssl_verification_mode)).to eql("full")
|
|
1199
|
-
end
|
|
1200
|
-
end
|
|
1201
|
-
end
|
|
1202
|
-
|
|
1203
1128
|
describe "retry_on_conflict" do
|
|
1204
1129
|
let(:num_retries) { 123 }
|
|
1205
1130
|
let(:event) { LogStash::Event.new("myactionfield" => "update", "message" => "blah") }
|
|
@@ -195,3 +195,25 @@ describe "SSL options" do
|
|
|
195
195
|
end
|
|
196
196
|
end
|
|
197
197
|
|
|
198
|
+
# Move outside the SSL options describe block that has the after hook
|
|
199
|
+
describe "SSL obsolete settings" do
|
|
200
|
+
let(:base_settings) { { "hosts" => "localhost", "pool_max" => 1, "pool_max_per_route" => 1 } }
|
|
201
|
+
[
|
|
202
|
+
{name: 'ssl', replacement: 'ssl_enabled'},
|
|
203
|
+
{name: 'ssl_certificate_verification', replacement: 'ssl_verification_mode'},
|
|
204
|
+
{name: 'cacert', replacement: 'ssl_certificate_authorities'},
|
|
205
|
+
{name: 'truststore', replacement: 'ssl_truststore_path'},
|
|
206
|
+
{name: 'keystore', replacement: 'ssl_keystore_path'},
|
|
207
|
+
{name: 'truststore_password', replacement: 'ssl_truststore_password'},
|
|
208
|
+
{name: 'keystore_password', replacement: 'ssl_keystore_password'}
|
|
209
|
+
].each do |obsolete_setting|
|
|
210
|
+
context "with option #{obsolete_setting[:name]}" do
|
|
211
|
+
let(:settings) { base_settings.merge(obsolete_setting[:name] => "value") }
|
|
212
|
+
|
|
213
|
+
it "emits an error about the setting being obsolete" do
|
|
214
|
+
error_text = /The setting `#{obsolete_setting[:name]}` in plugin `elasticsearch` is obsolete and is no longer available. (Use|Set) '#{obsolete_setting[:replacement]}' instead/i
|
|
215
|
+
expect { LogStash::Outputs::ElasticSearch.new(settings) }.to raise_error LogStash::ConfigurationError, error_text
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
end
|
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:
|
|
4
|
+
version: 12.0.0
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Elastic
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-12-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|