From cfb1876ce75fc9600a3d58d2ba282ebbe9f69819 Mon Sep 17 00:00:00 2001 From: Arpan Patnaik Date: Wed, 17 Jul 2019 09:08:23 -0600 Subject: [PATCH] Commit to add is_gzipped into the mix for making optional checks on compressed files without gz extensions. --- lib/logstash/inputs/s3.rb | 5 ++++- logstash-input-s3.gemspec | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/logstash/inputs/s3.rb b/lib/logstash/inputs/s3.rb index 23d458c..553d2a5 100644 --- a/lib/logstash/inputs/s3.rb +++ b/lib/logstash/inputs/s3.rb @@ -79,6 +79,9 @@ class LogStash::Inputs::S3 < LogStash::Inputs::Base # be present. config :include_object_properties, :validate => :boolean, :default => false + # Pass boolean to see if the source file may not have the .gz extension but is actually zipped. + config :is_gzipped, :validate => :boolean, :default => false + public def register require "fileutils" @@ -315,7 +318,7 @@ def read_gzip_file(filename, block) private def gzip?(filename) - filename.end_with?('.gz','.gzip') + filename.end_with?('.gz','.gzip') or @is_gzipped end private diff --git a/logstash-input-s3.gemspec b/logstash-input-s3.gemspec index ff3e382..6792ed1 100644 --- a/logstash-input-s3.gemspec +++ b/logstash-input-s3.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'logstash-input-s3' - s.version = '3.4.1' + s.version = '3.4.2' s.licenses = ['Apache-2.0'] s.summary = "Streams events from files in a S3 bucket" 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"