logstash-input-elasticsearch 4.13.0 → 4.14.0

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: d87078bdf63844901c7684624bc15bd6af23c71c728adb20b86ba76738957926
4
- data.tar.gz: 34d8ce81035665b93623aec9008c511000b80a463c0cf482fb459249c763aeaf
3
+ metadata.gz: 1bd8f2c20c31a39f42e8f32e32edbfef275a15de8040491b8d2549f55a3e9002
4
+ data.tar.gz: 68abc131e2c9ec958cc3360137b273b39303923d60b7dca4303aa43bf1425574
5
5
  SHA512:
6
- metadata.gz: 4b2c5aa7a229bdbc89df35276c22a72f1cdbefc03a9069dfb74e64aad64d121aeb3ee67a9b632fd8ab445d1a256cce23f67feabb4ff379ed78a15507f28b1dce
7
- data.tar.gz: 7c7a45cd3817d9e746a03eb166293e389eee16fc512bb2e0ecc546158d67f1f4e0f54bc191212e02ce1af206fe5f98374d70defa3f8ef218bed9e210ac8a8a65
6
+ metadata.gz: 801739c8baf2655104a502176b42157c35c282dab719ec0bf0eb4274feef9ce6e79238870aa6ebb2604f4da726446089e94d4e5e8d48c50d731eaae55c447be9
7
+ data.tar.gz: 5af8ea0a963ce1d8d924b51428dbb70c9ab9e9d0df0146e2b5f0013ae5b13e56b934dc2540e7ce11080b4ed33c52afb66695bd08739a6a701c337b11d94a3c72
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 4.14.0
2
+ - Refactor: switch to using scheduler mixin [#177](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/177)
3
+
1
4
  ## 4.13.0
2
5
  - Added support for `ca_trusted_fingerprint` when run on Logstash 8.3+ [#178](https://github.com/logstash-plugins/logstash-input-elasticsearch/pull/178)
3
6
 
@@ -8,6 +8,7 @@ require 'logstash/plugin_mixins/event_support/event_factory_adapter'
8
8
  require 'logstash/plugin_mixins/ecs_compatibility_support'
9
9
  require 'logstash/plugin_mixins/ecs_compatibility_support/target_check'
10
10
  require 'logstash/plugin_mixins/ca_trusted_fingerprint_support'
11
+ require "logstash/plugin_mixins/scheduler"
11
12
  require "base64"
12
13
 
13
14
  require "elasticsearch"
@@ -78,6 +79,8 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
78
79
 
79
80
  extend LogStash::PluginMixins::ValidatorSupport::FieldReferenceValidationAdapter
80
81
 
82
+ include LogStash::PluginMixins::Scheduler
83
+
81
84
  config_name "elasticsearch"
82
85
 
83
86
  # List of elasticsearch hosts to use for querying.
@@ -251,21 +254,13 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
251
254
 
252
255
  def run(output_queue)
253
256
  if @schedule
254
- @scheduler = Rufus::Scheduler.new(:max_work_threads => 1)
255
- @scheduler.cron @schedule do
256
- do_run(output_queue)
257
- end
258
-
259
- @scheduler.join
257
+ scheduler.cron(@schedule) { do_run(output_queue) }
258
+ scheduler.join
260
259
  else
261
260
  do_run(output_queue)
262
261
  end
263
262
  end
264
263
 
265
- def stop
266
- @scheduler.stop if @scheduler
267
- end
268
-
269
264
  private
270
265
 
271
266
  def do_run(output_queue)
@@ -274,9 +269,10 @@ class LogStash::Inputs::Elasticsearch < LogStash::Inputs::Base
274
269
 
275
270
  logger.warn("managed slices for query is very large (#{@slices}); consider reducing") if @slices > 8
276
271
 
272
+ pipeline_id = execution_context&.pipeline_id || 'main'
277
273
  @slices.times.map do |slice_id|
278
274
  Thread.new do
279
- LogStash::Util::set_thread_name("#{@id}_slice_#{slice_id}")
275
+ LogStash::Util::set_thread_name("[#{pipeline_id}]|input|elasticsearch|slice_#{slice_id}")
280
276
  do_run_slice(output_queue, slice_id)
281
277
  end
282
278
  end.map(&:join)
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-elasticsearch'
4
- s.version = '4.13.0'
4
+ s.version = '4.14.0'
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"
@@ -24,13 +24,13 @@ Gem::Specification.new do |s|
24
24
  s.add_runtime_dependency 'logstash-mixin-ecs_compatibility_support', '~> 1.3'
25
25
  s.add_runtime_dependency 'logstash-mixin-event_support', '~> 1.0'
26
26
  s.add_runtime_dependency "logstash-mixin-validator_support", '~> 1.0'
27
+ s.add_runtime_dependency "logstash-mixin-scheduler", '~> 1.0'
27
28
 
28
29
  s.add_runtime_dependency 'elasticsearch', '>= 7.17.1'
29
30
  s.add_runtime_dependency 'logstash-mixin-ca_trusted_fingerprint_support', '~> 1.0'
30
31
 
31
32
  s.add_runtime_dependency 'tzinfo'
32
33
  s.add_runtime_dependency 'tzinfo-data'
33
- s.add_runtime_dependency 'rufus-scheduler'
34
34
  s.add_runtime_dependency 'manticore', ">= 0.7.1"
35
35
 
36
36
  s.add_development_dependency 'logstash-codec-plain'
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.13.0
4
+ version: 4.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-24 00:00:00.000000000 Z
11
+ date: 2022-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -72,6 +72,20 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '1.0'
75
+ - !ruby/object:Gem::Dependency
76
+ requirement: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '1.0'
81
+ name: logstash-mixin-scheduler
82
+ prerelease: false
83
+ type: :runtime
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '1.0'
75
89
  - !ruby/object:Gem::Dependency
76
90
  requirement: !ruby/object:Gem::Requirement
77
91
  requirements:
@@ -128,20 +142,6 @@ dependencies:
128
142
  - - ">="
129
143
  - !ruby/object:Gem::Version
130
144
  version: '0'
131
- - !ruby/object:Gem::Dependency
132
- requirement: !ruby/object:Gem::Requirement
133
- requirements:
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- version: '0'
137
- name: rufus-scheduler
138
- prerelease: false
139
- type: :runtime
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - ">="
143
- - !ruby/object:Gem::Version
144
- version: '0'
145
145
  - !ruby/object:Gem::Dependency
146
146
  requirement: !ruby/object:Gem::Requirement
147
147
  requirements: