logstash-input-cloudflare 0.9.1 → 0.9.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
  SHA1:
3
- metadata.gz: 1092862dc49784086c7b33ee78df8cb6596b1b3a
4
- data.tar.gz: ce657c567f7a9c2571c723cadb6f2ef598064ae5
3
+ metadata.gz: 085cf38020417111f4172fe95693004884b01246
4
+ data.tar.gz: 3425837336a0f57199abcc04f9c4eb960277d867
5
5
  SHA512:
6
- metadata.gz: b983c8fbb702181e88324e6a2ffd00731ec9793d379d918600a84807fc787b697f2d584f6607ebd816432a49b18794cf6ce021ac60f411d4832b51ea417d4c9f
7
- data.tar.gz: 4473dff4ebf3284cf66d242e939ea6693f6f84dfca74d3524924f46420eede05b4fbfea99274347ba177148959eb5d2f02fa36de1e53edc67fb6f316b699a53b
6
+ metadata.gz: f094121047dd883418352a333ad2fc45dcf1e23a17bfd7bb2f888bffa1affe4b12b018798d03bd373ff3df1de87b6ea763aaf3f456c0410b46f0613de5f2fba7
7
+ data.tar.gz: 02388bd90d140c45298c30b26e640e201d95865fdf72cb8c0cddc0e7caafd71a7617fd4b42b77a82efed035feca1d5741f1b078b042f8cc81cf4d31ad908e484
@@ -235,16 +235,19 @@ class LogStash::Inputs::Cloudflare < LogStash::Inputs::Base
235
235
  metadata['last_timestamp'] = entry['timestamp'] / 1_000_000_000
236
236
  end
237
237
  @logger.info(metadata)
238
- if !metadata['last_timestamp'] && metadata['first_timestamp']
238
+ if metadata['first_timestamp']
239
+ mod_tstamp = metadata['first_timestamp'].to_i + 120
240
+ else
241
+ mod_tstamp = nil
242
+ end
243
+ if !metadata['last_timestamp'] && metadata['first_timestamp'] && \
244
+ mod_tstamp <= metadata['default_start_time']
239
245
  # we need to increment the timestamp by 2 minutes as we haven't
240
246
  # received any results in the last batch ... also make sure we
241
247
  # only do this if the end date is more than 10 minutes from the
242
248
  # current time
243
- mod_tstamp = metadata['first_timestamp'].to_i + 120
244
- unless mod_tstamp > metadata['default_start_time']
245
- @logger.info('Incrementing start timestamp by 120 seconds')
246
- metadata['last_timestamp'] = mod_tstamp
247
- end
249
+ @logger.info('Incrementing start timestamp by 120 seconds')
250
+ metadata['last_timestamp'] = mod_tstamp
248
251
  else # if
249
252
  @logger.info("Waiting #{@poll_time} seconds before requesting data"\
250
253
  'from Cloudflare again')
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-cloudflare'
3
- s.version = '0.9.1'
3
+ s.version = '0.9.2'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = 'This logstash input plugin fetches logs from Cloudflare using'\
6
6
  'their API'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-cloudflare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Serko