logstash-input-elasticsearch 4.20.0 → 4.20.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2f89fa4a24aa44a90e6587f7e1e7200a64198c7a2daac985204632309ce7d35
|
4
|
+
data.tar.gz: a5fbe5a017b80c86ac6d87f96fd6892f6678b0ddc3b2e0b53da14805c2241848
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15aebcabed876f5f05a1a3076736fd53e4485c420210e482c76745380f689687aaa336bc6e0c3c6e31a13ca9ff12fb16c4b70e1c1f88df41a8d41c59879c22d1
|
7
|
+
data.tar.gz: afa2124136c904c54daeac924df2138e0791aab8b91a5a1ceb0e9b86c81bd5ffcada45d211a2decc9a8c712e6bfbeadd0cd45d975891b46c023495b0c52a009d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 4.20.2
|
2
|
+
- fix case when aggregation returns an error [#204](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/204)
|
3
|
+
|
4
|
+
## 4.20.1
|
5
|
+
- Fix license header [#203](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/203)
|
6
|
+
|
1
7
|
## 4.20.0
|
2
8
|
- Added `response_type` configuration option to allow processing result of aggregations [#202](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/202)
|
3
9
|
|
@@ -1,7 +1,3 @@
|
|
1
|
-
# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
2
|
-
# or more contributor license agreements. Licensed under the Elastic License;
|
3
|
-
# you may not use this file except in compliance with the Elastic License.
|
4
|
-
|
5
1
|
require 'stud/try'
|
6
2
|
|
7
3
|
module LogStash module Helpers
|
@@ -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.
|
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.
|
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-
|
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
|