logstash-input-http_poller 3.3.4 → 4.0.0

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
  SHA1:
3
- metadata.gz: 510d4c5db5222815c8af25d28a88199ad7f777b3
4
- data.tar.gz: 013097dc6abeb229fc0928b9dc8018c7b38de19d
3
+ metadata.gz: 81e33eb7700b8e32405f5e6560c673d9e267e720
4
+ data.tar.gz: 66fdfbd250e994f9af430efe2a247f0817d9eeaa
5
5
  SHA512:
6
- metadata.gz: 06d85c637163581b719c3819bfd4a0efc59a548a86352ac003382454c4fee031a66a9083573191a534e54856a41b3fd3e26565e58fd39ba827d822b5e6ac77f6
7
- data.tar.gz: 6dd62b76ea1bbeffec57c9248fbecc995c5babd296d329d0cd96ba7e46160b8d40f1386e2cc92406333e95f4890082a613610aefdcccbe3fd4b2996d0d374143
6
+ metadata.gz: 0153c85b2138939833e3a88127ab445d4968de32cf9e33a84813f3ec05415bc4e63c734d2da85894c90cbc8bb73e5e27af7d7104a9a44fda8a63b36971b42fb9
7
+ data.tar.gz: 79e243ac0a8bf5cf66cc80e36dc1f090775029c89b695bd60b317f869aefe30773de4ffd11e221d6c82b423a7fede3efa4f150c8c1b27867df079387b385a583
data/CHANGELOG.md CHANGED
@@ -1,11 +1,6 @@
1
- ## 3.3.4
2
- - Docs: Remove ssl_certificate_validation option from the docs
3
-
4
- ## 3.3.3
5
- - Don't bleed URls credentials on startup or on exception #82
6
-
7
- ## 3.3.2
8
- - Documentation fixes
1
+ ## 4.0.0
2
+ - Mark deprecated field `interval` as obsolete
3
+ - bump dependency in logstash-mixin-http_client
9
4
 
10
5
  ## 3.3.0
11
6
  - Add top level user/password options that apply to all URLs by default.
@@ -19,7 +14,6 @@
19
14
 
20
15
  ## 3.1.1
21
16
  - Handle empty bodies correctly
22
-
23
17
  ## 3.1.0
24
18
  - Use rufus-scheduler for more flexible scheduling. Many thanks to [@hummingV](https://github.com/hummingV) for this contribution. ([#58](https://github.com/logstash-plugins/logstash-input-http_poller/pull/58))
25
19
 
data/docs/index.asciidoc CHANGED
@@ -81,7 +81,7 @@ The above snippet will create two files `downloaded_cert.pem` and `downloaded_tr
81
81
  }
82
82
  truststore => "/path/to/downloaded_truststore.jks"
83
83
  truststore_password => "mypassword"
84
- interval => 30
84
+ schedule => { cron => "* * * * * UTC"}
85
85
  }
86
86
  ----------------------------------
87
87
 
@@ -115,6 +115,7 @@ This plugin supports the following configuration options plus the <<plugins-{typ
115
115
  | <<plugins-{type}s-{plugin}-retry_non_idempotent>> |<<boolean,boolean>>|No
116
116
  | <<plugins-{type}s-{plugin}-schedule>> |<<hash,hash>>|No
117
117
  | <<plugins-{type}s-{plugin}-socket_timeout>> |<<number,number>>|No
118
+ | <<plugins-{type}s-{plugin}-ssl_certificate_validation>> |<<boolean,boolean>>|No
118
119
  | <<plugins-{type}s-{plugin}-target>> |<<string,string>>|No
119
120
  | <<plugins-{type}s-{plugin}-truststore>> |a valid filesystem path|No
120
121
  | <<plugins-{type}s-{plugin}-truststore_password>> |<<password,password>>|No
@@ -204,18 +205,6 @@ across requests as a normal web browser would. Enabled by default
204
205
 
205
206
  Should redirects be followed? Defaults to `true`
206
207
 
207
- [id="plugins-{type}s-{plugin}-interval"]
208
- ===== `interval` (DEPRECATED)
209
-
210
- * DEPRECATED WARNING: This configuration item is deprecated and may not be available in future versions.
211
- * Value type is <<number,number>>
212
- * There is no default value for this setting.
213
-
214
- How often (in seconds) the urls will be called
215
- DEPRECATED. Use 'schedule' option instead.
216
- If both interval and schedule options are specified, interval
217
- option takes higher precedence
218
-
219
208
  [id="plugins-{type}s-{plugin}-keepalive"]
220
209
  ===== `keepalive`
221
210
 
@@ -17,11 +17,7 @@ class LogStash::Inputs::HTTP_Poller < LogStash::Inputs::Base
17
17
  # The name and the url will be passed in the outputed event
18
18
  config :urls, :validate => :hash, :required => true
19
19
 
20
- # How often (in seconds) the urls will be called
21
- # DEPRECATED. Use 'schedule' option instead.
22
- # If both interval and schedule options are specified, interval
23
- # option takes higher precedence
24
- config :interval, :validate => :number, :deprecated => true
20
+ config :interval, :validate => :number, :obsolete => "The interval options is obsolete. Use schedule instead"
25
21
 
26
22
  # Schedule of when to periodically poll from the urls
27
23
  # Format: A hash with
@@ -31,7 +27,7 @@ class LogStash::Inputs::HTTP_Poller < LogStash::Inputs::Base
31
27
  # a) { "every" => "1h" }
32
28
  # b) { "cron" => "* * * * * UTC" }
33
29
  # See: rufus/scheduler for details about different schedule options and value string format
34
- config :schedule, :validate => :hash
30
+ config :schedule, :validate => :hash, :required => true
35
31
 
36
32
  # Define the target field for placing the received data. If this setting is omitted, the data will be stored at the root (top level) of the event.
37
33
  config :target, :validate => :string
@@ -46,7 +42,8 @@ class LogStash::Inputs::HTTP_Poller < LogStash::Inputs::Base
46
42
  def register
47
43
  @host = Socket.gethostname.force_encoding(Encoding::UTF_8)
48
44
 
49
- @logger.info("Registering http_poller Input", :type => @type, :interval => @interval, :schedule => @schedule, :timeout => @timeout)
45
+ @logger.info("Registering http_poller Input", :type => @type,
46
+ :urls => @urls, :schedule => @schedule, :timeout => @timeout)
50
47
 
51
48
  setup_requests!
52
49
  end
@@ -123,28 +120,7 @@ class LogStash::Inputs::HTTP_Poller < LogStash::Inputs::Base
123
120
 
124
121
  public
125
122
  def run(queue)
126
- #interval or schedule must be provided. Must be exclusively either one. Not neither. Not both.
127
- raise LogStash::ConfigurationError, "Invalid config. Neither interval nor schedule was specified." \
128
- unless @interval || @schedule
129
- raise LogStash::ConfigurationError, "Invalid config. Specify only interval or schedule. Not both." \
130
- if @interval && @schedule
131
-
132
- if @interval
133
- setup_interval(queue)
134
- elsif @schedule
135
- setup_schedule(queue)
136
- else
137
- #should not reach here
138
- raise LogStash::ConfigurationError, "Invalid config. Neither interval nor schedule was specified."
139
- end
140
- end
141
-
142
- private
143
- def setup_interval(queue)
144
- @interval_thread = Thread.current
145
- Stud.interval(@interval) do
146
- run_once(queue)
147
- end
123
+ setup_schedule(queue)
148
124
  end
149
125
 
150
126
  def setup_schedule(queue)
@@ -242,13 +218,6 @@ class LogStash::Inputs::HTTP_Poller < LogStash::Inputs::Base
242
218
  :name => name,
243
219
  :url => request
244
220
  )
245
-
246
- @logger.debug? && @logger.debug("Cannot read URL or send the error as an event!",
247
- :exception => e,
248
- :exception_message => e.message,
249
- :exception_backtrace => e.backtrace,
250
- :name => name,
251
- :url => request)
252
221
  end
253
222
 
254
223
  private
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-http_poller'
3
- s.version = '3.3.4'
3
+ s.version = '4.0.0'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "Poll HTTP endpoints with Logstash."
6
6
  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"
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  # Gem dependencies
21
21
  s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
22
22
  s.add_runtime_dependency 'logstash-codec-plain'
23
- s.add_runtime_dependency 'logstash-mixin-http_client', ">= 5.0.0", "< 6.0.0"
23
+ s.add_runtime_dependency 'logstash-mixin-http_client', ">= 6.0.0", "< 7.0.0"
24
24
  s.add_runtime_dependency 'stud', "~> 0.0.22"
25
25
  s.add_runtime_dependency 'rufus-scheduler', "~>3.0.9"
26
26
 
@@ -177,56 +177,6 @@ describe LogStash::Inputs::HTTP_Poller do
177
177
  end
178
178
 
179
179
  describe "scheduler configuration" do
180
- context "given an interval" do
181
- let(:opts) {
182
- {
183
- "interval" => 2,
184
- "urls" => default_urls,
185
- "codec" => "json",
186
- "metadata_target" => metadata_target
187
- }
188
- }
189
- it "should run once in each interval" do
190
- instance = klass.new(opts)
191
- instance.register
192
- queue = Queue.new
193
- runner = Thread.new do
194
- instance.run(queue)
195
- end
196
- #T 0123456
197
- #events x x x x
198
- #expects 3 events at T=5
199
- sleep 5
200
- instance.stop
201
- runner.kill
202
- runner.join
203
- expect(queue.size).to eq(3)
204
- end
205
- end
206
-
207
- context "given both interval and schedule options" do
208
- let(:opts) {
209
- {
210
- "interval" => 1,
211
- "schedule" => { "every" => "5s" },
212
- "urls" => default_urls,
213
- "codec" => "json",
214
- "metadata_target" => metadata_target
215
- }
216
- }
217
- it "should raise ConfigurationError" do
218
- instance = klass.new(opts)
219
- instance.register
220
- queue = Queue.new
221
- runner = Thread.new do
222
- expect{instance.run(queue)}.to raise_error(LogStash::ConfigurationError)
223
- end
224
- instance.stop
225
- runner.kill
226
- runner.join
227
- end
228
- end
229
-
230
180
  context "given 'cron' expression" do
231
181
  let(:opts) {
232
182
  {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-http_poller
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.4
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-21 00:00:00.000000000 Z
12
+ date: 2017-08-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement
@@ -50,10 +50,10 @@ dependencies:
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 5.0.0
53
+ version: 6.0.0
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
- version: 6.0.0
56
+ version: 7.0.0
57
57
  name: logstash-mixin-http_client
58
58
  prerelease: false
59
59
  type: :runtime
@@ -61,10 +61,10 @@ dependencies:
61
61
  requirements:
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
- version: 5.0.0
64
+ version: 6.0.0
65
65
  - - "<"
66
66
  - !ruby/object:Gem::Version
67
- version: 6.0.0
67
+ version: 7.0.0
68
68
  - !ruby/object:Gem::Dependency
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements: