logstash-filter-elastic_integration 8.17.0-java → 8.17.2-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a573be36ffb3dcbedb2b5fcad10a996f48f5382502704bb3b34b011161e8ec1d
4
- data.tar.gz: c01bc40b553158df6d5f4e2b87718646c7a287cbea44766a357e50d6870a9406
3
+ metadata.gz: 9755f640fc6546ce573f5749c9657fc67161583951584db0a4843d905ba440f4
4
+ data.tar.gz: 72f354b7af4b97042bb12664678ff6f4607af9b91cf5526ec7322b92fea84114
5
5
  SHA512:
6
- metadata.gz: e48d0384d2f2db3bb7eae70e3e5eadab39f49c80d557fd079fa2a56972cc4ccab80ae741545b581d94ec2f3577c6319c12ed8d7823f6eb326e1cee6efead1e2a
7
- data.tar.gz: 24c87ed71cc21f629b75a46eb074fcab6ebe15b27d9f360a126dfd864ac617be57a7c7371f4717feb0602f66dd5c5dd754252bac783fdd3230384f4e92199dff
6
+ metadata.gz: 1c04809c2e1afd33faa9a751cc75cd233af0edc2eab3882726520549e11263df6565d00216b742836d2c31ece306fc446b9611d920eec18e85c4722c37e72595
7
+ data.tar.gz: fc3fd083171bae4debb7153c0b24b2ccf73280c2c1c00ecda4edabaf3285037a509990c6d48aadd0910f9ad128e3b1d206606b065d0aca7d722a015c7465c445
data/VERSION CHANGED
@@ -1 +1 @@
1
- 8.17.0
1
+ 8.17.2
@@ -8,4 +8,4 @@
8
8
  ########################################################################
9
9
 
10
10
  require 'jar_dependencies'
11
- require_jar('co/elastic', 'logstash-filter-elastic_integration', '8.17.0')
11
+ require_jar('co/elastic', 'logstash-filter-elastic_integration', '8.17.2')
@@ -7,4 +7,4 @@
7
7
  # with the Elastic License 2.0.
8
8
  ########################################################################
9
9
 
10
- LogStash::Filters::ElasticIntegration::VERSION='8.17.0'
10
+ LogStash::Filters::ElasticIntegration::VERSION='8.17.2'
@@ -40,6 +40,9 @@ class LogStash::Filters::ElasticIntegration < LogStash::Filters::Base
40
40
  # Any special characters present in the URLs here MUST be URL escaped! This means `#` should be put in as `%23` for instance.
41
41
  config :hosts, :validate => :uri, :list => true
42
42
 
43
+ # An HTTP forward proxy to use for connecting to the Elasticsearch cluster.
44
+ config :proxy, :validate => :uri
45
+
43
46
  # Cloud ID, from the Elastic Cloud web console. If set `hosts` should not be used.
44
47
  #
45
48
  # For more details, check out the https://www.elastic.co/guide/en/logstash/current/connecting-to-cloud.html#_cloud_id[cloud documentation]
@@ -135,6 +138,7 @@ class LogStash::Filters::ElasticIntegration < LogStash::Filters::Base
135
138
  initialize_event_processor!
136
139
 
137
140
  perform_preflight_check!
141
+ check_versions_alignment
138
142
  end # def register
139
143
 
140
144
  def filter(event)
@@ -311,6 +315,7 @@ class LogStash::Filters::ElasticIntegration < LogStash::Filters::Base
311
315
 
312
316
  builder.setHosts @hosts&.map(&:to_s)
313
317
  builder.setCloudId @cloud_id
318
+ builder.setProxy @proxy&.to_s
314
319
 
315
320
  builder.setSslEnabled @ssl_enabled
316
321
 
@@ -345,8 +350,8 @@ class LogStash::Filters::ElasticIntegration < LogStash::Filters::Base
345
350
 
346
351
  if serverless?
347
352
  @elasticsearch_rest_client = _elasticsearch_rest_client(config) do |builder|
348
- builder.configureElasticApi { |elasticApi| elasticApi.setApiVersion(ELASTIC_API_VERSION) }
349
- end
353
+ builder.configureElasticApi { |elasticApi| elasticApi.setApiVersion(ELASTIC_API_VERSION) }
354
+ end
350
355
  end
351
356
  end
352
357
 
@@ -374,13 +379,24 @@ class LogStash::Filters::ElasticIntegration < LogStash::Filters::Base
374
379
  end
375
380
 
376
381
  def perform_preflight_check!
382
+ connected_es_version_info
377
383
  check_user_privileges!
378
384
  check_es_cluster_license!
379
385
  end
380
386
 
381
- def check_user_privileges!
387
+ def preflight_check_instance
382
388
  java_import('co.elastic.logstash.filters.elasticintegration.PreflightCheck')
383
- PreflightCheck.new(@elasticsearch_rest_client).checkUserPrivileges
389
+ @preflight_check ||= PreflightCheck.new(@elasticsearch_rest_client)
390
+ end
391
+
392
+ def connected_es_version_info
393
+ @connected_es_version_info ||= preflight_check_instance.getElasticsearchVersionInfo
394
+ rescue => e
395
+ raise_config_error!(e.message)
396
+ end
397
+
398
+ def check_user_privileges!
399
+ preflight_check_instance.checkUserPrivileges
384
400
  rescue => e
385
401
  security_error_message = "no handler found for uri [/_security/user/_has_privileges]"
386
402
  if e.message.include?(security_error_message)
@@ -403,17 +419,13 @@ class LogStash::Filters::ElasticIntegration < LogStash::Filters::Base
403
419
  end
404
420
 
405
421
  def check_es_cluster_license!
406
- java_import('co.elastic.logstash.filters.elasticintegration.PreflightCheck')
407
- PreflightCheck.new(@elasticsearch_rest_client).checkLicense
422
+ preflight_check_instance.checkLicense
408
423
  rescue => e
409
424
  raise_config_error!(e.message)
410
425
  end
411
426
 
412
427
  def serverless?
413
- java_import('co.elastic.logstash.filters.elasticintegration.PreflightCheck')
414
- PreflightCheck.new(@elasticsearch_rest_client).isServerless
415
- rescue => e
416
- raise_config_error!(e.message)
428
+ connected_es_version_info["build_flavor"] == 'serverless'
417
429
  end
418
430
 
419
431
  ##
@@ -454,4 +466,44 @@ class LogStash::Filters::ElasticIntegration < LogStash::Filters::Base
454
466
  ERR
455
467
  end
456
468
  end
469
+
470
+ ##
471
+ # compares the current plugin version with the Elasticsearch version connected to
472
+ # generates a warning or info message based on the situation where the plugin is ahead or behind of the connected Elasticsearch
473
+ def check_versions_alignment
474
+ plugin_major_version, plugin_minor_version = VERSION.split('.').map(&:to_i)
475
+ es_major_version, es_minor_version = connected_es_version_info["number"].split('.').first(2).map(&:to_i)
476
+
477
+ logger.info("This #{VERSION} version of plugin embedded Ingest node components from Elasticsearch #{plugin_major_version}.#{plugin_minor_version}")
478
+
479
+ es_full_version = connected_es_version_info["number"]
480
+
481
+ if es_major_version > plugin_major_version
482
+ logger.warn "This plugin v#{VERSION} is connected to a newer MAJOR " +
483
+ "version of Elasticsearch v#{es_full_version}, and may " +
484
+ "have trouble loading or running pipelines that use new " +
485
+ "features; for the best experience, update this plugin " +
486
+ "to at least v#{es_major_version}.#{es_minor_version}."
487
+ elsif es_major_version < plugin_major_version
488
+ logger.warn "This plugin v#{VERSION} is connected to an older MAJOR " +
489
+ "version of Elasticsearch v#{es_full_version}, and may " +
490
+ "have trouble loading or running pipelines that use " +
491
+ "features that were deprecated before Elasticsearch " +
492
+ "v#{plugin_major_version}.0; for the best experience, " +
493
+ "align major/minor versions across the Elastic Stack."
494
+ elsif es_minor_version > plugin_minor_version
495
+ logger.warn "This plugin v#{VERSION} is connected to a newer MINOR " +
496
+ "version of Elasticsearch v#{es_full_version}, and may " +
497
+ "have trouble loading or running pipelines that use new " +
498
+ "features; for the best experience, update this plugin to " +
499
+ "at least v#{es_major_version}.#{es_minor_version}."
500
+ elsif es_minor_version < plugin_minor_version
501
+ logger.info "This plugin v#{VERSION} is connected to an older MINOR " +
502
+ "version of Elasticsearch v#{es_full_version}; for the best experience, " +
503
+ "align major/minor versions across the Elastic Stack."
504
+ else
505
+ logger.debug "This plugin v#{VERSION} is connected to the same MAJOR/MINOR " +
506
+ "version of Elasticsearch v#{es_full_version}."
507
+ end
508
+ end
457
509
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-elastic_integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.17.0
4
+ version: 8.17.2
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-08 00:00:00.000000000 Z
11
+ date: 2025-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -75,7 +75,7 @@ files:
75
75
  - lib/logstash/filters/elastic_integration/jar_dependencies.rb
76
76
  - lib/logstash/filters/elastic_integration/version.rb
77
77
  - logstash-filter-elastic_integration.gemspec
78
- - vendor/jar-dependencies/co/elastic/logstash-filter-elastic_integration/8.17.0/logstash-filter-elastic_integration-8.17.0.jar
78
+ - vendor/jar-dependencies/co/elastic/logstash-filter-elastic_integration/8.17.2/logstash-filter-elastic_integration-8.17.2.jar
79
79
  homepage: https://www.elastic.co/logstash
80
80
  licenses:
81
81
  - ELv2