logstash-input-s3-sns-sqs 1.4.5 → 1.4.6
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 +4 -4
 - data/CHANGELOG.md +3 -0
 - data/lib/logstash/inputs/s3snssqs.rb +20 -22
 - data/logstash-input-s3-sns-sqs.gemspec +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: b306531064b4c30538ebf2825ad8ccd3cffc1723
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 3166705bd066e00607cfb5f8f6e0b5d810934ef2
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: ee7ba71f4ed496dc0cc109ea1834d0da58d112c320fb6c8a80f33ee65ab9a1f0746976be6ad32f934c4f80f9a3c0688f94a64064f44d665bbce3f3d19bb699b0
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: b614c2c3945819b6e95052f1770920d57b83d5afb9300836e6af1375b45c93c15c7117b14fdd33372edbe746cc796e5b967dc75b131b03d9eb0e7ba73cd65797
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
| 
         @@ -98,9 +98,6 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable 
     | 
|
| 
       98 
98 
     | 
    
         | 
| 
       99 
99 
     | 
    
         
             
              default :codec, "plain"
         
     | 
| 
       100 
100 
     | 
    
         | 
| 
       101 
     | 
    
         
            -
              # The message string to use in the event.
         
     | 
| 
       102 
     | 
    
         
            -
              config :message, :validate => :string, :default => "Hello World!"
         
     | 
| 
       103 
     | 
    
         
            -
             
     | 
| 
       104 
101 
     | 
    
         
             
              # Name of the SQS Queue to pull messages from. Note that this is just the name of the queue, not the URL or ARN.
         
     | 
| 
       105 
102 
     | 
    
         
             
              config :queue, :validate => :string, :required => true
         
     | 
| 
       106 
103 
     | 
    
         
             
              config :s3_key_prefix, :validate => :string, :default => ''
         
     | 
| 
         @@ -148,22 +145,20 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable 
     | 
|
| 
       148 
145 
     | 
    
         
             
              end
         
     | 
| 
       149 
146 
     | 
    
         | 
| 
       150 
147 
     | 
    
         
             
              def setup_queue
         
     | 
| 
       151 
     | 
    
         
            -
                 
     | 
| 
       152 
     | 
    
         
            -
             
     | 
| 
       153 
     | 
    
         
            -
             
     | 
| 
       154 
     | 
    
         
            -
             
     | 
| 
       155 
     | 
    
         
            -
                   
     | 
| 
       156 
     | 
    
         
            -
             
     | 
| 
       157 
     | 
    
         
            -
             
     | 
| 
       158 
     | 
    
         
            -
                   
     | 
| 
       159 
     | 
    
         
            -
                    @s3_client = Aws::S3::Client.new(aws_options_hash)
         
     | 
| 
       160 
     | 
    
         
            -
                  end
         
     | 
| 
       161 
     | 
    
         
            -
             
     | 
| 
       162 
     | 
    
         
            -
                  @s3_resource = get_s3object
         
     | 
| 
       163 
     | 
    
         
            -
                rescue Aws::SQS::Errors::ServiceError => e
         
     | 
| 
       164 
     | 
    
         
            -
                  @logger.error("Cannot establish connection to Amazon SQS", :error => e)
         
     | 
| 
       165 
     | 
    
         
            -
                  raise LogStash::ConfigurationError, "Verify the SQS queue name and your credentials"
         
     | 
| 
      
 148 
     | 
    
         
            +
                aws_sqs_client = Aws::SQS::Client.new(aws_options_hash)
         
     | 
| 
      
 149 
     | 
    
         
            +
                queue_url = aws_sqs_client.get_queue_url({ queue_name: @queue, queue_owner_aws_account_id: @queue_owner_aws_account_id})[:queue_url]
         
     | 
| 
      
 150 
     | 
    
         
            +
                @poller = Aws::SQS::QueuePoller.new(queue_url, :client => aws_sqs_client)
         
     | 
| 
      
 151 
     | 
    
         
            +
                if s3_access_key_id and s3_secret_access_key
         
     | 
| 
      
 152 
     | 
    
         
            +
                  @logger.debug("Using S3 Credentials from config", :ID => aws_options_hash.merge(:access_key_id => s3_access_key_id, :secret_access_key => s3_secret_access_key) )
         
     | 
| 
      
 153 
     | 
    
         
            +
                  @s3_client = Aws::S3::Client.new(aws_options_hash.merge(:access_key_id => s3_access_key_id, :secret_access_key => s3_secret_access_key))
         
     | 
| 
      
 154 
     | 
    
         
            +
                else
         
     | 
| 
      
 155 
     | 
    
         
            +
                  @s3_client = Aws::S3::Client.new(aws_options_hash)
         
     | 
| 
       166 
156 
     | 
    
         
             
                end
         
     | 
| 
      
 157 
     | 
    
         
            +
             
     | 
| 
      
 158 
     | 
    
         
            +
                @s3_resource = get_s3object
         
     | 
| 
      
 159 
     | 
    
         
            +
              rescue Aws::SQS::Errors::ServiceError => e
         
     | 
| 
      
 160 
     | 
    
         
            +
                @logger.error("Cannot establish connection to Amazon SQS", :error => e)
         
     | 
| 
      
 161 
     | 
    
         
            +
                raise LogStash::ConfigurationError, "Verify the SQS queue name and your credentials"
         
     | 
| 
       167 
162 
     | 
    
         
             
              end
         
     | 
| 
       168 
163 
     | 
    
         | 
| 
       169 
164 
     | 
    
         
             
              def polling_options
         
     | 
| 
         @@ -351,8 +346,7 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable 
     | 
|
| 
       351 
346 
     | 
    
         
             
                  block.call(line)
         
     | 
| 
       352 
347 
     | 
    
         
             
                end
         
     | 
| 
       353 
348 
     | 
    
         
             
              rescue ZipException => e
         
     | 
| 
       354 
     | 
    
         
            -
                @logger.error("Gzip codec: We cannot uncompress the gzip file", :filename => filename)
         
     | 
| 
       355 
     | 
    
         
            -
                raise e
         
     | 
| 
      
 349 
     | 
    
         
            +
                @logger.error("Gzip codec: We cannot uncompress the gzip file", :filename => filename, error => e)
         
     | 
| 
       356 
350 
     | 
    
         
             
              ensure
         
     | 
| 
       357 
351 
     | 
    
         
             
                buffered.close unless buffered.nil?
         
     | 
| 
       358 
352 
     | 
    
         
             
                decoder.close unless decoder.nil?
         
     | 
| 
         @@ -473,10 +467,14 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable 
     | 
|
| 
       473 
467 
     | 
    
         
             
              private
         
     | 
| 
       474 
468 
     | 
    
         
             
              def hash_key_is_regex(myhash)
         
     | 
| 
       475 
469 
     | 
    
         
             
                myhash.default_proc = lambda do |hash, lookup|
         
     | 
| 
      
 470 
     | 
    
         
            +
                  result=nil
         
     | 
| 
       476 
471 
     | 
    
         
             
                  hash.each_pair do |key, value|
         
     | 
| 
       477 
     | 
    
         
            -
                     
     | 
| 
      
 472 
     | 
    
         
            +
                    if %r[#{key}] =~ lookup
         
     | 
| 
      
 473 
     | 
    
         
            +
                      result=value
         
     | 
| 
      
 474 
     | 
    
         
            +
                      break
         
     | 
| 
      
 475 
     | 
    
         
            +
                    end
         
     | 
| 
       478 
476 
     | 
    
         
             
                  end
         
     | 
| 
       479 
     | 
    
         
            -
                   
     | 
| 
      
 477 
     | 
    
         
            +
                  result
         
     | 
| 
       480 
478 
     | 
    
         
             
                end
         
     | 
| 
       481 
479 
     | 
    
         
             
              end
         
     | 
| 
       482 
480 
     | 
    
         
             
            end # class
         
     | 
| 
         @@ -1,6 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       2 
2 
     | 
    
         
             
              s.name            = 'logstash-input-s3-sns-sqs'
         
     | 
| 
       3 
     | 
    
         
            -
              s.version         = '1.4. 
     | 
| 
      
 3 
     | 
    
         
            +
              s.version         = '1.4.6'
         
     | 
| 
       4 
4 
     | 
    
         
             
              s.licenses        = ['Apache License (2.0)']
         
     | 
| 
       5 
5 
     | 
    
         
             
              s.summary         = "Get logs from AWS s3 buckets as issued by an object-created event via sns -> sqs."
         
     | 
| 
       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/plugin install gemname. This gem is not a stand-alone program"
         
     |