logstash-output-elasticsearch 11.0.4-java → 11.0.5-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: f054da12af7761adfdd86d912602ad164e407d89a3965637763f51f341389185
4
- data.tar.gz: b82ed842fa924dff112cc3b755f4bf08645f6e2ee39f820f39d5ce5f4700f6ed
3
+ metadata.gz: 2e275e2ca3a658814c730aaaa7464f81826dba01d8f2fb305859dc9aa33f0f34
4
+ data.tar.gz: f3dd23896923260bb9939e4ef90e56cf44c0daa0571b0987be3e39c45b9749c4
5
5
  SHA512:
6
- metadata.gz: ea4d348ab10fc9caf3df58a9b13adc8b234d4e13834137006845507d74050f22499f6d957d2559436718ce76ced97ae4e11637d5f2da988f48ae7b8218db1118
7
- data.tar.gz: ba9983c8a214de9793d30b3845c0f9a536ea2e67b909788d821262f7217d5127343d6dd0fb22a675895cc04aad2df9c723874f40248e87734a10204c8aec81d6
6
+ metadata.gz: 315cc2c6a4097f3923f76899c3bd5d58bb1ff779bc6aaaef4798cdf2db6a2d368ca0a8627e15e36e39b80484ad5bfea96ff7a9d77235c266627c9d4ef76f49c8
7
+ data.tar.gz: ae0591ff34ed9c88afd9b897c490e1787a28b68f44ff98816cd3ef5784cca71fd7d670c7aeee6b634ca01f837aaa2839198ec0fa8ed70454d2c0916e09e0293f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 11.0.5
2
+ - Fixed running post-register action when Elasticsearch status change from unhealthy to healthy [#1035](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1035)
3
+
1
4
  ## 11.0.4
2
5
  - [DOC] Clarify that `http_compression` applies to _requests_, and remove noise about _response_ decompression [#1000](https://github.com/logstash-plugins/logstash-output-elasticsearch/pull/1000)
3
6
 
@@ -92,6 +92,10 @@ module LogStash; module Outputs; class ElasticSearch;
92
92
  @pool.maximum_seen_major_version
93
93
  end
94
94
 
95
+ def alive_urls_count
96
+ @pool.alive_urls_count
97
+ end
98
+
95
99
  def bulk(actions)
96
100
  @action_count ||= 0
97
101
  @action_count += actions.size
@@ -128,8 +128,12 @@ module LogStash; module PluginMixins; module ElasticSearch
128
128
  client.maximum_seen_major_version
129
129
  end
130
130
 
131
+ def alive_urls_count
132
+ client.alive_urls_count
133
+ end
134
+
131
135
  def successful_connection?
132
- !!maximum_seen_major_version
136
+ !!maximum_seen_major_version && alive_urls_count > 0
133
137
  end
134
138
 
135
139
  # launch a thread that waits for an initial successful connection to the ES cluster to call the given block
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-elasticsearch'
3
- s.version = '11.0.4'
3
+ s.version = '11.0.5'
4
4
 
5
5
  s.licenses = ['apache-2.0']
6
6
  s.summary = "Stores logs in Elasticsearch"
@@ -55,4 +55,18 @@ describe "elasticsearch is down on startup", :integration => true do
55
55
  expect(r).to have_hits(2)
56
56
  end
57
57
 
58
+ 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"))
60
+ subject.register
61
+ Thread.new do
62
+ 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
64
+ end
65
+ subject.multi_receive([event1, event2])
66
+ @es.indices.refresh
67
+ r = @es.search(index: 'logstash-*')
68
+ expect(r).to have_hits(2)
69
+ expect(subject.plugin_metadata.get(:cluster_uuid)).not_to be_empty
70
+ expect(subject.plugin_metadata.get(:cluster_uuid)).not_to eq("_na_")
71
+ end if ESHelper.es_version_satisfies?(">=7")
58
72
  end
@@ -934,6 +934,7 @@ describe LogStash::Outputs::ElasticSearch do
934
934
  allow(subject).to receive(:last_es_version).and_return es_version
935
935
  # make successful_connection? return true:
936
936
  allow(subject).to receive(:maximum_seen_major_version).and_return Integer(es_version.split('.').first)
937
+ allow(subject).to receive(:alive_urls_count).and_return Integer(1)
937
938
  allow(subject).to receive(:stop_after_successful_connection_thread)
938
939
  end
939
940
 
@@ -12,6 +12,7 @@ describe "whitelisting error types in expected behavior" do
12
12
  before :each do
13
13
  allow(subject.logger).to receive(:warn)
14
14
  allow(subject).to receive(:maximum_seen_major_version).and_return(0)
15
+ allow(subject).to receive(:alive_urls_count).and_return(1)
15
16
  allow(subject).to receive(:finish_register)
16
17
 
17
18
  subject.register
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: 11.0.4
4
+ version: 11.0.5
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-26 00:00:00.000000000 Z
11
+ date: 2021-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement