logstash-input-elasticsearch 4.20.3 → 4.20.5

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: 1da6df030d6db058a1c0bcb6b99b38252f4643f491c661d90f4227b0f06076dc
4
- data.tar.gz: d86e024f2946d2c9bf309658022047dd48c82b8c766ca71fbba290ff2113e0cd
3
+ metadata.gz: eaa000218cac721012284803638cb681c0eccf02107c34b03e597998a2e9eee3
4
+ data.tar.gz: eef84d9f24f1346b1d4793f6b10f200e790739f63d588888bae1bcdae33ec51f
5
5
  SHA512:
6
- metadata.gz: c688445304b1f88e43394a926f0f14c4405797a8841d1b35ddef9adafdcce1acacaef2221c82e852863e9ba15935b0e96b3d2a59e45c0802632c6aea16278ff2
7
- data.tar.gz: 8600b782e75a5874fd4377f124882cc34a7761153ffe2b96d8d85e222e632e7cafa6c81a699a5de8882c27c1d18142d407c6fad3e6b0ea2d558edd1e6ac28acc
6
+ metadata.gz: a9ed0836e937e4ceb9726d05be77e39a10cc11189bbf0cffb829e4445f5e6948e339187c2f088d1d9408657c26318375756d974299667fdf86d62b77ba6f00d5
7
+ data.tar.gz: 3e919b494b24d4d61a98222e27310a6d0e2f9d1d2b6209b2879c80199dd4c69e39b789a2d6e7503e07fe3097d50261f78d0c4ab7300bd48d6cf79a5d28c66c01
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 4.20.5
2
+ - Add `x-elastic-product-origin` header to Elasticsearch requests [#211](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/211)
3
+
4
+ ## 4.20.4
5
+ - Fix issue where the `index` parameter was being ignored when using `response_type => aggregations` [#209](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/209)
6
+
1
7
  ## 4.20.3
2
8
  - [DOC] Update link to bypass redirect, resolving directly to correct content [#206](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/206)
3
9
 
@@ -16,7 +16,7 @@ module LogStash
16
16
  @query = @plugin_params["query"]
17
17
  @retries = @plugin_params["retries"]
18
18
  @agg_options = {
19
- :index => @index,
19
+ :index => @plugin_params["index"],
20
20
  :size => 0
21
21
  }.merge(:body => @query)
22
22
 
@@ -271,6 +271,7 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
271
271
 
272
272
  BUILD_FLAVOR_SERVERLESS = 'serverless'.freeze
273
273
  DEFAULT_EAV_HEADER = { "Elastic-Api-Version" => "2023-10-31" }.freeze
274
+ INTERNAL_ORIGIN_HEADER = { 'x-elastic-product-origin' => 'logstash-input-elasticsearch'}.freeze
274
275
 
275
276
  def initialize(params={})
276
277
  super(params)
@@ -300,6 +301,7 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
300
301
  fill_user_password_from_cloud_auth
301
302
 
302
303
  transport_options = {:headers => {}}
304
+ transport_options[:headers].merge!(INTERNAL_ORIGIN_HEADER)
303
305
  transport_options[:headers].merge!(setup_basic_auth(user, password))
304
306
  transport_options[:headers].merge!(setup_api_key(api_key))
305
307
  transport_options[:headers].merge!({'user-agent' => prepare_user_agent()})
@@ -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.3'
4
+ s.version = '4.20.5'
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"
@@ -50,6 +50,12 @@ describe LogStash::Inputs::Elasticsearch, :ecs_compatibility_support do
50
50
  client = plugin.send(:client)
51
51
  expect( extract_transport(client).options[:transport_options][:headers] ).not_to match hash_including("Elastic-Api-Version" => "2023-10-31")
52
52
  end
53
+
54
+ it "sets an x-elastic-product-origin header identifying this as an internal plugin request" do
55
+ plugin.register
56
+ client = plugin.send(:client)
57
+ expect( extract_transport(client).options[:transport_options][:headers] ).to match hash_including("x-elastic-product-origin"=>"logstash-input-elasticsearch")
58
+ end
53
59
  end
54
60
 
55
61
  context "against not authentic Elasticsearch" do
@@ -90,6 +96,12 @@ describe LogStash::Inputs::Elasticsearch, :ecs_compatibility_support do
90
96
  client = plugin.send(:client)
91
97
  expect( extract_transport(client).options[:transport_options][:headers] ).to match hash_including("Elastic-Api-Version" => "2023-10-31")
92
98
  end
99
+
100
+ it "sets an x-elastic-product-origin header identifying this as an internal plugin request" do
101
+ plugin.register
102
+ client = plugin.send(:client)
103
+ expect( extract_transport(client).options[:transport_options][:headers] ).to match hash_including("x-elastic-product-origin"=>"logstash-input-elasticsearch")
104
+ end
93
105
  end
94
106
  end
95
107
 
@@ -1036,12 +1048,14 @@ describe LogStash::Inputs::Elasticsearch, :ecs_compatibility_support do
1036
1048
  end
1037
1049
 
1038
1050
  context "aggregations" do
1051
+ let(:index_name) { "rainbow" }
1039
1052
  let(:config) do
1040
1053
  {
1041
1054
  'hosts' => ["localhost"],
1042
1055
  'query' => '{ "query": {}, "size": 0, "aggs":{"total_count": { "value_count": { "field": "type" }}, "empty_count": { "sum": { "field": "_meta.empty_event" }}}}',
1043
1056
  'response_type' => 'aggregations',
1044
- 'size' => 0
1057
+ 'size' => 0,
1058
+ 'index' => index_name
1045
1059
  }
1046
1060
  end
1047
1061
 
@@ -1080,7 +1094,7 @@ describe LogStash::Inputs::Elasticsearch, :ecs_compatibility_support do
1080
1094
  before { plugin.register }
1081
1095
 
1082
1096
  it 'creates the events from the aggregations' do
1083
- expect(client).to receive(:search).with(any_args).and_return(mock_response)
1097
+ expect(client).to receive(:search).with(hash_including(:body => anything, :size => 0, :index => index_name)).and_return(mock_response)
1084
1098
  plugin.run queue
1085
1099
  event = queue.pop
1086
1100
 
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.3
4
+ version: 4.20.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-11 00:00:00.000000000 Z
11
+ date: 2024-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -20,8 +20,8 @@ dependencies:
20
20
  - !ruby/object:Gem::Version
21
21
  version: '2.99'
22
22
  name: logstash-core-plugin-api
23
- prerelease: false
24
23
  type: :runtime
24
+ prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
@@ -37,8 +37,8 @@ dependencies:
37
37
  - !ruby/object:Gem::Version
38
38
  version: '1.3'
39
39
  name: logstash-mixin-ecs_compatibility_support
40
- prerelease: false
41
40
  type: :runtime
41
+ prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
@@ -51,8 +51,8 @@ dependencies:
51
51
  - !ruby/object:Gem::Version
52
52
  version: '1.0'
53
53
  name: logstash-mixin-event_support
54
- prerelease: false
55
54
  type: :runtime
55
+ prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
@@ -65,8 +65,8 @@ dependencies:
65
65
  - !ruby/object:Gem::Version
66
66
  version: '1.0'
67
67
  name: logstash-mixin-validator_support
68
- prerelease: false
69
68
  type: :runtime
69
+ prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
@@ -79,8 +79,8 @@ dependencies:
79
79
  - !ruby/object:Gem::Version
80
80
  version: '1.0'
81
81
  name: logstash-mixin-scheduler
82
- prerelease: false
83
82
  type: :runtime
83
+ prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
@@ -93,8 +93,8 @@ dependencies:
93
93
  - !ruby/object:Gem::Version
94
94
  version: 7.17.9
95
95
  name: elasticsearch
96
- prerelease: false
97
96
  type: :runtime
97
+ prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
@@ -107,8 +107,8 @@ dependencies:
107
107
  - !ruby/object:Gem::Version
108
108
  version: '1.0'
109
109
  name: logstash-mixin-ca_trusted_fingerprint_support
110
- prerelease: false
111
110
  type: :runtime
111
+ prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
@@ -121,8 +121,8 @@ dependencies:
121
121
  - !ruby/object:Gem::Version
122
122
  version: '1.0'
123
123
  name: logstash-mixin-normalize_config_support
124
- prerelease: false
125
124
  type: :runtime
125
+ prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
@@ -135,8 +135,8 @@ dependencies:
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  name: tzinfo
138
- prerelease: false
139
138
  type: :runtime
139
+ prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - ">="
@@ -149,8 +149,8 @@ dependencies:
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
151
  name: tzinfo-data
152
- prerelease: false
153
152
  type: :runtime
153
+ prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - ">="
@@ -163,8 +163,8 @@ dependencies:
163
163
  - !ruby/object:Gem::Version
164
164
  version: 0.7.1
165
165
  name: manticore
166
- prerelease: false
167
166
  type: :runtime
167
+ prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - ">="
@@ -177,8 +177,8 @@ dependencies:
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
179
  name: logstash-codec-plain
180
- prerelease: false
181
180
  type: :development
181
+ prerelease: false
182
182
  version_requirements: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - ">="
@@ -191,8 +191,8 @@ dependencies:
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
193
  name: logstash-devutils
194
- prerelease: false
195
194
  type: :development
195
+ prerelease: false
196
196
  version_requirements: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - ">="
@@ -205,8 +205,8 @@ dependencies:
205
205
  - !ruby/object:Gem::Version
206
206
  version: '0'
207
207
  name: timecop
208
- prerelease: false
209
208
  type: :development
209
+ prerelease: false
210
210
  version_requirements: !ruby/object:Gem::Requirement
211
211
  requirements:
212
212
  - - ">="
@@ -219,8 +219,8 @@ dependencies:
219
219
  - !ruby/object:Gem::Version
220
220
  version: '0.6'
221
221
  name: cabin
222
- prerelease: false
223
222
  type: :development
223
+ prerelease: false
224
224
  version_requirements: !ruby/object:Gem::Requirement
225
225
  requirements:
226
226
  - - "~>"
@@ -233,8 +233,8 @@ dependencies:
233
233
  - !ruby/object:Gem::Version
234
234
  version: '0'
235
235
  name: webrick
236
- prerelease: false
237
236
  type: :development
237
+ prerelease: false
238
238
  version_requirements: !ruby/object:Gem::Requirement
239
239
  requirements:
240
240
  - - ">="
@@ -247,8 +247,8 @@ dependencies:
247
247
  - !ruby/object:Gem::Version
248
248
  version: 3.0.9
249
249
  name: rufus-scheduler
250
- prerelease: false
251
250
  type: :development
251
+ prerelease: false
252
252
  version_requirements: !ruby/object:Gem::Requirement
253
253
  requirements:
254
254
  - - "~>"
@@ -307,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
307
  - !ruby/object:Gem::Version
308
308
  version: '0'
309
309
  requirements: []
310
- rubygems_version: 3.2.33
310
+ rubygems_version: 3.3.26
311
311
  signing_key:
312
312
  specification_version: 4
313
313
  summary: Reads query results from an Elasticsearch cluster