logstash-input-s3 3.8.2 → 3.8.3

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: 1efe9981371c5b8306ef18f09c13fff78558b66ae2ee667bd2c576b8b88218e9
4
- data.tar.gz: 843c506610bd7ca9c48759cb7339f80e65211c17df9c3a83c8a5ca6fe850f39f
3
+ metadata.gz: 584ac32b0d4a7d0c3d478b90ad92d3170d5926d6d802d46b31a5075fc7bd27e9
4
+ data.tar.gz: 2a24ecd946ce52b6aa29acf3352314a26750c9b1350f33ecd685f0e206cd5d4a
5
5
  SHA512:
6
- metadata.gz: 0cd8360c8eafce836259fada827ab42fc1972a42cec30bafe4ed7d61bea222bcc3db0c4a1ee19471a3727dffd7e9170ad48c0fe57baff5408e76e5ea60de3d44
7
- data.tar.gz: 2cdeb2452504940dbd999d838d1abd905108ae748c9efa7ab9788a67b9e79c139f247c360c33393ce742189e27bb3a8763bde1725c95c76145884b0aa7a54039
6
+ metadata.gz: c306fb6d68a0b58cbb109508590d07cbd9cca9b67534e039c2fad2cc033e8756bdddd2ecde0f9177e8faf2ec65e4fb84f8b2e6576d65742d32f0867da0ab10b0
7
+ data.tar.gz: 293e978d3301e7d545927daa5a087bc433bf948d18662bf97cfb164dd59928c7e58719b6dcc7ede1fbed6c5d9b519c416ff44a043a5fd130123a1bf64d86231e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.8.3
2
+ - Fix missing `metadata` and `type` of the last event [#223](https://github.com/logstash-plugins/logstash-input-s3/pull/223)
3
+
1
4
  ## 3.8.2
2
5
  - Refactor: read sincedb time once per bucket listing [#233](https://github.com/logstash-plugins/logstash-input-s3/pull/233)
3
6
 
@@ -235,30 +235,34 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base
235
235
  @logger.debug('Event is metadata, updating the current cloudfront metadata', :event => event)
236
236
  update_metadata(metadata, event)
237
237
  else
238
- decorate(event)
239
-
240
- if @include_object_properties
241
- event.set("[@metadata][s3]", object.data.to_h)
242
- else
243
- event.set("[@metadata][s3]", {})
244
- end
245
-
246
- event.set("[@metadata][s3][key]", object.key)
247
- event.set(@cloudfront_version_key, metadata[:cloudfront_version]) unless metadata[:cloudfront_version].nil?
248
- event.set(@cloudfront_fields_key, metadata[:cloudfront_fields]) unless metadata[:cloudfront_fields].nil?
249
-
250
- queue << event
238
+ push_decoded_event(queue, metadata, object, event)
251
239
  end
252
240
  end
253
241
  end
254
242
  # #ensure any stateful codecs (such as multi-line ) are flushed to the queue
255
243
  @codec.flush do |event|
256
- queue << event
244
+ push_decoded_event(queue, metadata, object, event)
257
245
  end
258
246
 
259
247
  return true
260
248
  end # def process_local_log
261
249
 
250
+ def push_decoded_event(queue, metadata, object, event)
251
+ decorate(event)
252
+
253
+ if @include_object_properties
254
+ event.set("[@metadata][s3]", object.data.to_h)
255
+ else
256
+ event.set("[@metadata][s3]", {})
257
+ end
258
+
259
+ event.set("[@metadata][s3][key]", object.key)
260
+ event.set(@cloudfront_version_key, metadata[:cloudfront_version]) unless metadata[:cloudfront_version].nil?
261
+ event.set(@cloudfront_fields_key, metadata[:cloudfront_fields]) unless metadata[:cloudfront_fields].nil?
262
+
263
+ queue << event
264
+ end
265
+
262
266
  def event_is_metadata?(event)
263
267
  return false unless event.get("message").class == String
264
268
  line = event.get("message")
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-s3'
4
- s.version = '3.8.2'
4
+ s.version = '3.8.3'
5
5
  s.licenses = ['Apache-2.0']
6
6
  s.summary = "Streams events from files in a S3 bucket"
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"
@@ -329,6 +329,7 @@ describe LogStash::Inputs::S3 do
329
329
  events = fetch_events(config)
330
330
  expect(events.size).to eq(events_to_process)
331
331
  expect(events[0].get("[@metadata][s3][key]")).to eql log.key
332
+ expect(events[1].get("[@metadata][s3][key]")).to eql log.key
332
333
  end
333
334
 
334
335
  it "deletes the temporary file" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.2
4
+ version: 3.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-27 00:00:00.000000000 Z
11
+ date: 2022-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement