logstash-filter-elasticsearch 3.10.0 → 3.11.0

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: 8e04ff9ca7407b8404764623b42f7ce8e754fe9ceafc6bde7cc064bc13c30723
4
- data.tar.gz: 3b317df7d5bc1b11c912e8f9d6ec14c2ef260fa975412f2ebbf2baf84da547ba
3
+ metadata.gz: 2fb1bc80bd95bd0e99591f07f0d2b0c76942d9a06618457e275679caeae9c0ec
4
+ data.tar.gz: 763fbbf17d77630c097bbbfa834842e8316830687a40a216704ee8902eb61e2a
5
5
  SHA512:
6
- metadata.gz: 6dd245e044d1c06882885e776ba64463c1dbfc93d3c80ad03ad4009b6a3b6246e5a166dc11c09cafb58f2b05b3a6e485741aef6a2137edc227081b1e06bf9e3c
7
- data.tar.gz: b9b211e1bf50bcb18d028e5322e78eaa3e113a034550eaae4ee3550b941e74235b5ed672417759eb35709e46693f7f602b8106ce13beb17bc6937eacbd991514
6
+ metadata.gz: 764940be26047fae75ffc160a5a75831599073c10a2f2712620984ea6fec3e04107efb6fa8c1b7e302e55387ab6629f88e3a82a460543f7a9a90c46ebf3c3ac2
7
+ data.tar.gz: 6a68318f5028c52265c42c3f939f43619427306964bb70453a1ca60444113601b662c45c6eb19fc65912c63b652707463879b2caba9a67f2aa9686736cd42d13
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.11.0
2
+ - Feat: update Elasticsearch client to 7.14.0 [#150](https://github.com/logstash-plugins/logstash-filter-elasticsearch/pull/150)
3
+
1
4
  ## 3.10.0
2
5
  - Feat: add user-agent header passed to the Elasticsearch HTTP connection [#152](https://github.com/logstash-plugins/logstash-filter-elasticsearch/pull/152)
3
6
 
@@ -320,6 +320,10 @@ class LogStash::Filters::Elasticsearch < LogStash::Filters::Base
320
320
  end
321
321
 
322
322
  def test_connection!
323
- get_client.client.ping
323
+ begin
324
+ get_client.client.ping
325
+ rescue Elasticsearch::UnsupportedProductError
326
+ raise LogStash::ConfigurationError, "Could not connect to a compatible version of Elasticsearch"
327
+ end
324
328
  end
325
329
  end #class LogStash::Filters::Elasticsearch
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-elasticsearch'
4
- s.version = '3.10.0'
4
+ s.version = '3.11.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Copies fields from previous log events in Elasticsearch to current events "
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"
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
 
22
22
  # Gem dependencies
23
23
  s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
24
- s.add_runtime_dependency 'elasticsearch', ">= 5.0.5" # LS >= 6.7 and < 7.14 all used version 5.0.5
24
+ s.add_runtime_dependency 'elasticsearch', ">= 7.14.0" # LS >= 6.7 and < 7.14 all used version 5.0.5
25
25
  s.add_runtime_dependency 'manticore', ">= 0.7.1"
26
26
  s.add_development_dependency 'cabin', ['~> 0.6']
27
27
  s.add_development_dependency 'webrick'
@@ -12,12 +12,34 @@ describe LogStash::Filters::Elasticsearch do
12
12
  context "registration" do
13
13
 
14
14
  let(:plugin) { LogStash::Plugin.lookup("filter", "elasticsearch").new({}) }
15
- before do
16
- allow(plugin).to receive(:test_connection!)
15
+
16
+ context "against authentic Elasticsearch" do
17
+ before do
18
+ allow(plugin).to receive(:test_connection!)
19
+ end
20
+
21
+ it "should not raise an exception" do
22
+ expect {plugin.register}.to_not raise_error
23
+ end
17
24
  end
18
25
 
19
- it "should not raise an exception" do
20
- expect {plugin.register}.to_not raise_error
26
+ context "against not authentic Elasticsearch" do
27
+ let(:failing_client) do
28
+ client = double("client")
29
+ allow(client).to receive(:ping).and_raise Elasticsearch::UnsupportedProductError
30
+
31
+ client_wrapper = double("filter_client")
32
+ allow(client_wrapper).to receive(:client).and_return client
33
+ client_wrapper
34
+ end
35
+
36
+ before do
37
+ allow(plugin).to receive(:get_client).and_return(failing_client)
38
+ end
39
+
40
+ it "should raise ConfigurationError" do
41
+ expect {plugin.register}.to raise_error(LogStash::ConfigurationError)
42
+ end
21
43
  end
22
44
  end
23
45
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 3.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-27 00:00:00.000000000 Z
11
+ date: 2021-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -35,7 +35,7 @@ dependencies:
35
35
  requirements:
36
36
  - - ">="
37
37
  - !ruby/object:Gem::Version
38
- version: 5.0.5
38
+ version: 7.14.0
39
39
  name: elasticsearch
40
40
  prerelease: false
41
41
  type: :runtime
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 5.0.5
46
+ version: 7.14.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  requirements: