logstash-input-elasticsearch 4.20.5 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/docs/index.asciidoc +42 -58
- data/lib/logstash/inputs/elasticsearch.rb +15 -47
- data/logstash-input-elasticsearch.gemspec +1 -1
- data/spec/inputs/elasticsearch_spec.rb +29 -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: b34b6c6d814152e88f320525ea0bb80bbf1e63ff962e022aaac0a2385dd087b6
|
4
|
+
data.tar.gz: d142df9148ad69bf838d62badeec71382118741938db61e6aad0676bdb918a37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19b2b1325ded83b5b93966365f855f104ba1881f2c991ffdbe92216e08d12d18a7b3ddd4a14d755f6d55c85c98e00d12ca566188c63706d6db1f0aa5b085048b
|
7
|
+
data.tar.gz: ff5de17e75281d8ddd0be70167f2c4dee0a90eef328c7e486b704e79fe10db7b7108b733f77438386a7abb18d504efbef5aaf7b0f34a6c8edd62791640514b7b
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## 5.0.0
|
2
|
+
- SSL settings that were marked deprecated in version `4.17.0` are now marked obsolete, and will prevent the plugin from starting.
|
3
|
+
- These settings are:
|
4
|
+
- `ssl`, which should bre replaced by `ssl_enabled`
|
5
|
+
- `ca_file`, which should bre replaced by `ssl_certificate_authorities`
|
6
|
+
- `ssl_certificate_verification`, which should bre replaced by `ssl_verification_mode`
|
7
|
+
- [#213](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/213)
|
8
|
+
|
1
9
|
## 4.20.5
|
2
10
|
- Add `x-elastic-product-origin` header to Elasticsearch requests [#211](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/211)
|
3
11
|
|
data/docs/index.asciidoc
CHANGED
@@ -23,7 +23,7 @@ include::{include_path}/plugin_header.asciidoc[]
|
|
23
23
|
|
24
24
|
Read from an Elasticsearch cluster, based on search query results.
|
25
25
|
This is useful for replaying test logs, reindexing, etc.
|
26
|
-
You can periodically schedule ingestion using a cron syntax
|
26
|
+
You can periodically schedule ingestion using a cron syntax
|
27
27
|
(see `schedule` setting) or run the query one time to load
|
28
28
|
data into Logstash.
|
29
29
|
|
@@ -96,7 +96,13 @@ TIP: Set the `target` option to avoid potential schema conflicts.
|
|
96
96
|
[id="plugins-{type}s-{plugin}-options"]
|
97
97
|
==== Elasticsearch Input configuration options
|
98
98
|
|
99
|
-
This plugin supports
|
99
|
+
This plugin supports these configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
|
100
|
+
|
101
|
+
NOTE: As of version `5.0.0` of this plugin, a number of previously deprecated settings related to SSL have been removed.
|
102
|
+
Please check out <<plugins-{type}s-{plugin}-obsolete-options>> for details.
|
103
|
+
|
104
|
+
NOTE: As of version `5.0.0` of this plugin, a number of previously deprecated settings related to SSL have been removed.
|
105
|
+
Please check out <<plugins-{type}s-{plugin}-obsolete-options>> for details.
|
100
106
|
|
101
107
|
[cols="<,<,<",options="header",]
|
102
108
|
|=======================================================================
|
@@ -106,6 +112,7 @@ This plugin supports the following configuration options plus the <<plugins-{typ
|
|
106
112
|
| <<plugins-{type}s-{plugin}-cloud_auth>> |<<password,password>>|No
|
107
113
|
| <<plugins-{type}s-{plugin}-cloud_id>> |<<string,string>>|No
|
108
114
|
| <<plugins-{type}s-{plugin}-connect_timeout_seconds>> | <<number,number>>|No
|
115
|
+
| <<plugins-{type}s-{plugin}-custom_headers>> |<<hash,hash>>|No
|
109
116
|
| <<plugins-{type}s-{plugin}-docinfo>> |<<boolean,boolean>>|No
|
110
117
|
| <<plugins-{type}s-{plugin}-docinfo_fields>> |<<array,array>>|No
|
111
118
|
| <<plugins-{type}s-{plugin}-docinfo_target>> |<<string,string>>|No
|
@@ -199,8 +206,18 @@ For more info, check out the
|
|
199
206
|
The maximum amount of time, in seconds, to wait while establishing a connection to Elasticsearch.
|
200
207
|
Connect timeouts tend to occur when Elasticsearch or an intermediate proxy is overloaded with requests and has exhausted its connection pool.
|
201
208
|
|
209
|
+
[id="plugins-{type}s-{plugin}-custom_headers"]
|
210
|
+
===== `custom_headers`
|
211
|
+
|
212
|
+
* Value type is <<hash,hash>>
|
213
|
+
* Default value is empty
|
214
|
+
|
215
|
+
Pass a set of key value pairs as the headers sent in each request to an elasticsearch node.
|
216
|
+
The headers will be used for any kind of request.
|
217
|
+
These custom headers will override any headers previously set by the plugin such as the User Agent or Authorization headers.
|
218
|
+
|
202
219
|
[id="plugins-{type}s-{plugin}-docinfo"]
|
203
|
-
===== `docinfo`
|
220
|
+
===== `docinfo`
|
204
221
|
|
205
222
|
* Value type is <<boolean,boolean>>
|
206
223
|
* Default value is `false`
|
@@ -251,7 +268,7 @@ Example
|
|
251
268
|
|
252
269
|
|
253
270
|
[id="plugins-{type}s-{plugin}-docinfo_fields"]
|
254
|
-
===== `docinfo_fields`
|
271
|
+
===== `docinfo_fields`
|
255
272
|
|
256
273
|
* Value type is <<array,array>>
|
257
274
|
* Default value is `["_index", "_type", "_id"]`
|
@@ -262,7 +279,7 @@ option lists the metadata fields to save in the current event. See
|
|
262
279
|
more information.
|
263
280
|
|
264
281
|
[id="plugins-{type}s-{plugin}-docinfo_target"]
|
265
|
-
===== `docinfo_target`
|
282
|
+
===== `docinfo_target`
|
266
283
|
|
267
284
|
* Value type is <<string,string>>
|
268
285
|
* Default value depends on whether <<plugins-{type}s-{plugin}-ecs_compatibility>> is enabled:
|
@@ -286,7 +303,7 @@ this option names the field under which to store the metadata fields as subfield
|
|
286
303
|
Controls this plugin's compatibility with the {ecs-ref}[Elastic Common Schema (ECS)].
|
287
304
|
|
288
305
|
[id="plugins-{type}s-{plugin}-hosts"]
|
289
|
-
===== `hosts`
|
306
|
+
===== `hosts`
|
290
307
|
|
291
308
|
* Value type is <<array,array>>
|
292
309
|
* There is no default value for this setting.
|
@@ -296,18 +313,18 @@ can be either IP, HOST, IP:port, or HOST:port. The port defaults to
|
|
296
313
|
9200.
|
297
314
|
|
298
315
|
[id="plugins-{type}s-{plugin}-index"]
|
299
|
-
===== `index`
|
316
|
+
===== `index`
|
300
317
|
|
301
318
|
* Value type is <<string,string>>
|
302
319
|
* Default value is `"logstash-*"`
|
303
320
|
|
304
|
-
The index or alias to search.
|
321
|
+
The index or alias to search.
|
305
322
|
Check out {ref}/api-conventions.html#api-multi-index[Multi Indices
|
306
323
|
documentation] in the Elasticsearch documentation for info on
|
307
324
|
referencing multiple indices.
|
308
325
|
|
309
326
|
[id="plugins-{type}s-{plugin}-password"]
|
310
|
-
===== `password`
|
327
|
+
===== `password`
|
311
328
|
|
312
329
|
* Value type is <<password,password>>
|
313
330
|
* There is no default value for this setting.
|
@@ -327,7 +344,7 @@ An empty string is treated as if proxy was not set, this is useful when using
|
|
327
344
|
environment variables e.g. `proxy => '${LS_PROXY:}'`.
|
328
345
|
|
329
346
|
[id="plugins-{type}s-{plugin}-query"]
|
330
|
-
===== `query`
|
347
|
+
===== `query`
|
331
348
|
|
332
349
|
* Value type is <<string,string>>
|
333
350
|
* Default value is `'{ "sort": [ "_doc" ] }'`
|
@@ -375,7 +392,7 @@ The default is 0 (no retry). This value should be equal to or greater than zero.
|
|
375
392
|
NOTE: Partial failures - such as errors in a subset of all slices - can result in the entire query being retried, which can lead to duplication of data. Avoiding this would require Logstash to store the entire result set of a query in memory which is often not possible.
|
376
393
|
|
377
394
|
[id="plugins-{type}s-{plugin}-schedule"]
|
378
|
-
===== `schedule`
|
395
|
+
===== `schedule`
|
379
396
|
|
380
397
|
* Value type is <<string,string>>
|
381
398
|
* There is no default value for this setting.
|
@@ -387,7 +404,7 @@ There is no schedule by default. If no schedule is given, then the statement is
|
|
387
404
|
exactly once.
|
388
405
|
|
389
406
|
[id="plugins-{type}s-{plugin}-scroll"]
|
390
|
-
===== `scroll`
|
407
|
+
===== `scroll`
|
391
408
|
|
392
409
|
* Value type is <<string,string>>
|
393
410
|
* Default value is `"1m"`
|
@@ -410,7 +427,7 @@ The query requires at least one `sort` field, as described in the <<plugins-{typ
|
|
410
427
|
`scroll` uses {ref}/paginate-search-results.html#scroll-search-results[scroll] API to search, which is no longer recommended.
|
411
428
|
|
412
429
|
[id="plugins-{type}s-{plugin}-size"]
|
413
|
-
===== `size`
|
430
|
+
===== `size`
|
414
431
|
|
415
432
|
* Value type is <<number,number>>
|
416
433
|
* Default value is `1000`
|
@@ -478,6 +495,8 @@ Enable SSL/TLS secured communication to Elasticsearch cluster.
|
|
478
495
|
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>>.
|
479
496
|
If no explicit protocol is specified plain HTTP will be used.
|
480
497
|
|
498
|
+
When not explicitly set, SSL will be automatically enabled if any of the specified hosts use HTTPS.
|
499
|
+
|
481
500
|
[id="plugins-{type}s-{plugin}-ssl_key"]
|
482
501
|
===== `ssl_key`
|
483
502
|
* Value type is <<path,path>>
|
@@ -598,7 +617,7 @@ It is also possible to target an entry in the event's metadata, which will be av
|
|
598
617
|
|
599
618
|
|
600
619
|
[id="plugins-{type}s-{plugin}-user"]
|
601
|
-
===== `user`
|
620
|
+
===== `user`
|
602
621
|
|
603
622
|
* Value type is <<string,string>>
|
604
623
|
* There is no default value for this setting.
|
@@ -608,56 +627,21 @@ option when authenticating to the Elasticsearch server. If set to an
|
|
608
627
|
empty string authentication will be disabled.
|
609
628
|
|
610
629
|
|
611
|
-
[id="plugins-{type}s-{plugin}-
|
612
|
-
==== Elasticsearch Input
|
630
|
+
[id="plugins-{type}s-{plugin}-obsolete-options"]
|
631
|
+
==== Elasticsearch Input Obsolete Configuration Options
|
613
632
|
|
614
|
-
|
633
|
+
WARNING: As of version `5.0.0` of this plugin, some configuration options have been replaced.
|
634
|
+
The plugin will fail to start if it contains any of these obsolete options.
|
615
635
|
|
616
|
-
WARNING: Deprecated options are subject to removal in future releases.
|
617
636
|
|
618
|
-
[cols="
|
637
|
+
[cols="<,<",options="header",]
|
619
638
|
|=======================================================================
|
620
|
-
|Setting|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
639
|
+
|Setting|Replaced by
|
640
|
+
| ca_file | <<plugins-{type}s-{plugin}-ssl_certificate_authorities>>
|
641
|
+
| ssl | <<plugins-{type}s-{plugin}-ssl_enabled>>
|
642
|
+
| ssl_certificate_verification | <<plugins-{type}s-{plugin}-ssl_verification_mode>>
|
624
643
|
|=======================================================================
|
625
644
|
|
626
|
-
[id="plugins-{type}s-{plugin}-ca_file"]
|
627
|
-
===== `ca_file`
|
628
|
-
deprecated[4.17.0, Replaced by <<plugins-{type}s-{plugin}-ssl_certificate_authorities>>]
|
629
|
-
|
630
|
-
* Value type is <<path,path>>
|
631
|
-
* There is no default value for this setting.
|
632
|
-
|
633
|
-
SSL Certificate Authority file in PEM encoded format, must also include any chain certificates as necessary.
|
634
|
-
|
635
|
-
[id="plugins-{type}s-{plugin}-ssl"]
|
636
|
-
===== `ssl`
|
637
|
-
deprecated[4.17.0, Replaced by <<plugins-{type}s-{plugin}-ssl_enabled>>]
|
638
|
-
|
639
|
-
* Value type is <<boolean,boolean>>
|
640
|
-
* Default value is `false`
|
641
|
-
|
642
|
-
If enabled, SSL will be used when communicating with the Elasticsearch
|
643
|
-
server (i.e. HTTPS will be used instead of plain HTTP).
|
644
|
-
|
645
|
-
|
646
|
-
[id="plugins-{type}s-{plugin}-ssl_certificate_verification"]
|
647
|
-
===== `ssl_certificate_verification`
|
648
|
-
deprecated[4.17.0, Replaced by <<plugins-{type}s-{plugin}-ssl_verification_mode>>]
|
649
|
-
|
650
|
-
* Value type is <<boolean,boolean>>
|
651
|
-
* Default value is `true`
|
652
|
-
|
653
|
-
Option to validate the server's certificate. Disabling this severely compromises security.
|
654
|
-
When certificate validation is disabled, this plugin implicitly trusts the machine
|
655
|
-
resolved at the given address without validating its proof-of-identity.
|
656
|
-
In this scenario, the plugin can transmit credentials to or process data from an untrustworthy
|
657
|
-
man-in-the-middle or other compromised infrastructure.
|
658
|
-
More information on the importance of certificate verification:
|
659
|
-
**https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf**.
|
660
|
-
|
661
645
|
[id="plugins-{type}s-{plugin}-common-options"]
|
662
646
|
include::{include_path}/{type}.asciidoc[]
|
663
647
|
|
@@ -24,9 +24,9 @@ require_relative "elasticsearch/patches/_elasticsearch_transport_connections_sel
|
|
24
24
|
# called `http.content_type.required`. If this option is set to `true`, and you
|
25
25
|
# are using Logstash 2.4 through 5.2, you need to update the Elasticsearch input
|
26
26
|
# plugin to version 4.0.2 or higher.
|
27
|
-
#
|
27
|
+
#
|
28
28
|
# ================================================================================
|
29
|
-
#
|
29
|
+
#
|
30
30
|
# Read from an Elasticsearch cluster, based on search query results.
|
31
31
|
# This is useful for replaying test logs, reindexing, etc.
|
32
32
|
# It also supports periodically scheduling lookup enrichments
|
@@ -166,6 +166,9 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
|
|
166
166
|
# http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_document_metadata.html
|
167
167
|
config :docinfo_fields, :validate => :array, :default => ['_index', '_type', '_id']
|
168
168
|
|
169
|
+
# Custom headers for Elasticsearch requests
|
170
|
+
config :custom_headers, :validate => :hash, :default => {}
|
171
|
+
|
169
172
|
# Basic Auth - username
|
170
173
|
config :user, :validate => :string
|
171
174
|
|
@@ -198,23 +201,12 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
|
|
198
201
|
# Set the address of a forward HTTP proxy.
|
199
202
|
config :proxy, :validate => :uri_or_empty
|
200
203
|
|
201
|
-
# SSL
|
202
|
-
config :ssl, :validate => :boolean, :default => false, :deprecated => "Set 'ssl_enabled' instead."
|
203
|
-
|
204
|
-
# SSL Certificate Authority file in PEM encoded format, must also include any chain certificates as necessary
|
205
|
-
config :ca_file, :validate => :path, :deprecated => "Set 'ssl_certificate_authorities' instead."
|
206
|
-
|
207
204
|
# OpenSSL-style X.509 certificate certificate to authenticate the client
|
208
205
|
config :ssl_certificate, :validate => :path
|
209
206
|
|
210
207
|
# SSL Certificate Authority files in PEM encoded format, must also include any chain certificates as necessary
|
211
208
|
config :ssl_certificate_authorities, :validate => :path, :list => true
|
212
209
|
|
213
|
-
# Option to validate the server's certificate. Disabling this severely compromises security.
|
214
|
-
# For more information on the importance of certificate verification please read
|
215
|
-
# https://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf
|
216
|
-
config :ssl_certificate_verification, :validate => :boolean, :default => true, :deprecated => "Set 'ssl_verification_mode' instead."
|
217
|
-
|
218
210
|
# The list of cipher suites to use, listed by priorities.
|
219
211
|
# Supported cipher suites vary depending on which version of Java is used.
|
220
212
|
config :ssl_cipher_suites, :validate => :string, :list => true
|
@@ -242,7 +234,6 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
|
|
242
234
|
config :ssl_truststore_password, :validate => :password
|
243
235
|
|
244
236
|
# The JKS truststore to validate the server's certificate.
|
245
|
-
# Use either `:ssl_truststore_path` or `:ssl_certificate_authorities`
|
246
237
|
config :ssl_truststore_path, :validate => :path
|
247
238
|
|
248
239
|
# The format of the truststore file. It must be either jks or pkcs12
|
@@ -264,6 +255,11 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
|
|
264
255
|
# If set, the _source of each hit will be added nested under the target instead of at the top-level
|
265
256
|
config :target, :validate => :field_reference
|
266
257
|
|
258
|
+
# Obsolete Settings
|
259
|
+
config :ssl, :obsolete => "Set 'ssl_enabled' instead."
|
260
|
+
config :ca_file, :obsolete => "Set 'ssl_certificate_authorities' instead."
|
261
|
+
config :ssl_certificate_verification, :obsolete => "Set 'ssl_verification_mode' instead."
|
262
|
+
|
267
263
|
# config :ca_trusted_fingerprint, :validate => :sha_256_hex
|
268
264
|
include LogStash::PluginMixins::CATrustedFingerprintSupport
|
269
265
|
|
@@ -305,6 +301,7 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
|
|
305
301
|
transport_options[:headers].merge!(setup_basic_auth(user, password))
|
306
302
|
transport_options[:headers].merge!(setup_api_key(api_key))
|
307
303
|
transport_options[:headers].merge!({'user-agent' => prepare_user_agent()})
|
304
|
+
transport_options[:headers].merge!(@custom_headers) unless @custom_headers.empty?
|
308
305
|
transport_options[:request_timeout] = @request_timeout_seconds unless @request_timeout_seconds.nil?
|
309
306
|
transport_options[:connect_timeout] = @connect_timeout_seconds unless @connect_timeout_seconds.nil?
|
310
307
|
transport_options[:socket_timeout] = @socket_timeout_seconds unless @socket_timeout_seconds.nil?
|
@@ -408,8 +405,6 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
|
|
408
405
|
ssl_options[:ssl] = true if @ssl_enabled
|
409
406
|
|
410
407
|
unless @ssl_enabled
|
411
|
-
# Keep it backward compatible with the deprecated `ssl` option
|
412
|
-
ssl_options[:trust_strategy] = trust_strategy_for_ca_trusted_fingerprint if original_params.include?('ssl')
|
413
408
|
return ssl_options
|
414
409
|
end
|
415
410
|
|
@@ -473,38 +468,11 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
|
|
473
468
|
end
|
474
469
|
|
475
470
|
def setup_ssl_params!
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
# Infer the value if neither the deprecate `ssl` and `ssl_enabled` were set
|
481
|
-
infer_ssl_enabled_from_hosts
|
482
|
-
|
483
|
-
@ssl_certificate_authorities = normalize_config(:ssl_certificate_authorities) do |normalize|
|
484
|
-
normalize.with_deprecated_mapping(:ca_file) do |ca_file|
|
485
|
-
[ca_file]
|
486
|
-
end
|
487
|
-
end
|
488
|
-
|
489
|
-
@ssl_verification_mode = normalize_config(:ssl_verification_mode) do |normalize|
|
490
|
-
normalize.with_deprecated_mapping(:ssl_certificate_verification) do |ssl_certificate_verification|
|
491
|
-
if ssl_certificate_verification == true
|
492
|
-
"full"
|
493
|
-
else
|
494
|
-
"none"
|
495
|
-
end
|
496
|
-
end
|
471
|
+
# Only infer ssl_enabled if it wasn't explicitly set
|
472
|
+
unless original_params.include?('ssl_enabled')
|
473
|
+
@ssl_enabled = effectively_ssl?
|
474
|
+
params['ssl_enabled'] = @ssl_enabled
|
497
475
|
end
|
498
|
-
|
499
|
-
params['ssl_enabled'] = @ssl_enabled
|
500
|
-
params['ssl_certificate_authorities'] = @ssl_certificate_authorities unless @ssl_certificate_authorities.nil?
|
501
|
-
params['ssl_verification_mode'] = @ssl_verification_mode unless @ssl_verification_mode.nil?
|
502
|
-
end
|
503
|
-
|
504
|
-
def infer_ssl_enabled_from_hosts
|
505
|
-
return if original_params.include?('ssl') || original_params.include?('ssl_enabled')
|
506
|
-
|
507
|
-
@ssl_enabled = params['ssl_enabled'] = effectively_ssl?
|
508
476
|
end
|
509
477
|
|
510
478
|
def setup_hosts
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-elasticsearch'
|
4
|
-
s.version = '
|
4
|
+
s.version = '5.0.0'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Reads query results from an Elasticsearch cluster"
|
7
7
|
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"
|
@@ -58,6 +58,19 @@ describe LogStash::Inputs::Elasticsearch, :ecs_compatibility_support do
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
+
describe 'handling obsolete settings' do
|
62
|
+
[{:name => 'ssl', :replacement => 'ssl_enabled', :sample_value => true},
|
63
|
+
{:name => 'ca_file', :replacement => 'ssl_certificate_authorities', :sample_value => 'spec/fixtures/test_certs/ca.crt'},
|
64
|
+
{:name => 'ssl_certificate_verification', :replacement => 'ssl_verification_mode', :sample_value => false }].each do | obsolete_setting|
|
65
|
+
context "with obsolete #{obsolete_setting[:name]}" do
|
66
|
+
let (:config) { {obsolete_setting[:name] => obsolete_setting[:sample_value]} }
|
67
|
+
it "should raise a config error with the appropriate message" do
|
68
|
+
expect { plugin.register }.to raise_error LogStash::ConfigurationError, /The setting `#{obsolete_setting[:name]}` in plugin `elasticsearch` is obsolete and is no longer available. Set '#{obsolete_setting[:replacement]}' instead/i
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
61
74
|
context "against not authentic Elasticsearch" do
|
62
75
|
before(:each) do
|
63
76
|
Elasticsearch::Client.send(:define_method, :ping) { raise Elasticsearch::UnsupportedProductError.new("Fake error") } # define error ping method
|
@@ -103,6 +116,22 @@ describe LogStash::Inputs::Elasticsearch, :ecs_compatibility_support do
|
|
103
116
|
expect( extract_transport(client).options[:transport_options][:headers] ).to match hash_including("x-elastic-product-origin"=>"logstash-input-elasticsearch")
|
104
117
|
end
|
105
118
|
end
|
119
|
+
|
120
|
+
context "with custom headers" do
|
121
|
+
let(:config) do
|
122
|
+
{
|
123
|
+
"schedule" => "* * * * * UTC",
|
124
|
+
"custom_headers" => { "Custom-Header-1" => "Custom Value 1", "Custom-Header-2" => "Custom Value 2" }
|
125
|
+
}
|
126
|
+
end
|
127
|
+
|
128
|
+
|
129
|
+
it "sets custom headers" do
|
130
|
+
plugin.register
|
131
|
+
client = plugin.send(:client)
|
132
|
+
expect( extract_transport(client).options[:transport_options][:headers] ).to match hash_including(config["custom_headers"])
|
133
|
+
end
|
134
|
+
end
|
106
135
|
end
|
107
136
|
|
108
137
|
context "retry" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-elasticsearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|