logstash-input-elasticsearch 4.20.1 → 4.20.2

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: 6d514926445adaa660e1e2f52cc8f453ff8e7fee24f15a66df8149ce8bb90a4d
4
- data.tar.gz: b3b3f8a9c7dcfae515724cbfae3d82152c6a03484fae88cd5520f3284bc87ae9
3
+ metadata.gz: f2f89fa4a24aa44a90e6587f7e1e7200a64198c7a2daac985204632309ce7d35
4
+ data.tar.gz: a5fbe5a017b80c86ac6d87f96fd6892f6678b0ddc3b2e0b53da14805c2241848
5
5
  SHA512:
6
- metadata.gz: 5facc890265d536b2846b7fc32cb12c1b266584822e0e56506788676d0b37b1f6ca0ab5b38393534a87c777a554abf0deb792734b6c7bcb3fe4d4fb2bc1c59e6
7
- data.tar.gz: 1e98e8a137f844a245ded3eb1eb0af4c2177d2e29fa5df5a9b63aac6a3b88796c643f71a809b96426c47b49b95a15b431b3c3493870ac622b58f0dac246021a3
6
+ metadata.gz: 15aebcabed876f5f05a1a3076736fd53e4485c420210e482c76745380f689687aaa336bc6e0c3c6e31a13ca9ff12fb16c4b70e1c1f88df41a8d41c59879c22d1
7
+ data.tar.gz: afa2124136c904c54daeac924df2138e0791aab8b91a5a1ceb0e9b86c81bd5ffcada45d211a2decc9a8c712e6bfbeadd0cd45d975891b46c023495b0c52a009d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 4.20.2
2
+ - fix case when aggregation returns an error [#204](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/204)
3
+
1
4
  ## 4.20.1
2
5
  - Fix license header [#203](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/203)
3
6
 
@@ -30,6 +30,7 @@ module LogStash
30
30
  error_details = {:message => e.message, :cause => e.cause}
31
31
  error_details[:backtrace] = e.backtrace if logger.debug?
32
32
  logger.error("Tried #{job_name} unsuccessfully", error_details)
33
+ false
33
34
  end
34
35
 
35
36
  def do_run(output_queue)
@@ -37,7 +38,7 @@ module LogStash
37
38
  r = retryable(AGGREGATION_JOB) do
38
39
  @client.search(@agg_options)
39
40
  end
40
- @plugin.push_hit(r, output_queue, 'aggregations')
41
+ @plugin.push_hit(r, output_queue, 'aggregations') if r
41
42
  end
42
43
  end
43
44
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-elasticsearch'
4
- s.version = '4.20.1'
4
+ s.version = '4.20.2'
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"
@@ -1071,17 +1071,16 @@ describe LogStash::Inputs::Elasticsearch, :ecs_compatibility_support do
1071
1071
  }
1072
1072
  end
1073
1073
 
1074
+ let(:client) { Elasticsearch::Client.new }
1074
1075
  before(:each) do
1075
- client = Elasticsearch::Client.new
1076
-
1077
1076
  expect(Elasticsearch::Client).to receive(:new).with(any_args).and_return(client)
1078
- expect(client).to receive(:search).with(any_args).and_return(mock_response)
1079
1077
  expect(client).to receive(:ping)
1080
1078
  end
1081
1079
 
1082
1080
  before { plugin.register }
1083
1081
 
1084
1082
  it 'creates the events from the aggregations' do
1083
+ expect(client).to receive(:search).with(any_args).and_return(mock_response)
1085
1084
  plugin.run queue
1086
1085
  event = queue.pop
1087
1086
 
@@ -1089,6 +1088,16 @@ describe LogStash::Inputs::Elasticsearch, :ecs_compatibility_support do
1089
1088
  expect(event.get("[total_counter][value]")).to eql 10
1090
1089
  expect(event.get("[empty_counter][value]")).to eql 5
1091
1090
  end
1091
+
1092
+ context "when there's an exception" do
1093
+ before(:each) do
1094
+ allow(client).to receive(:search).and_raise RuntimeError
1095
+ end
1096
+ it 'produces no events' do
1097
+ plugin.run queue
1098
+ expect(queue).to be_empty
1099
+ end
1100
+ end
1092
1101
  end
1093
1102
 
1094
1103
  context "retries" 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.20.1
4
+ version: 4.20.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-14 00:00:00.000000000 Z
11
+ date: 2024-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement