logstash-input-s3-sns-sqs 2.0.2 → 2.0.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: f80cbe20a92d1a3041719215f1e7324c3bd5043798b522ff4faa9fa826c2d4f3
4
- data.tar.gz: d64c634282dc1c60bdb4afac9dc98ee92937ed673b26cb7bb9c1ef782032d3df
3
+ metadata.gz: 037f46eeeb1316d0e6a108b5f573ebc9a56649a3ddc0d97276898defbf1e3c5e
4
+ data.tar.gz: f5b670848c3c7c4da6d00a9a8e224bfe11447eafda3dc0d4f9e03a90e1890562
5
5
  SHA512:
6
- metadata.gz: 10772e588d70541bbf235417845ddcc7c6fb9487e505fe2dea86d83335a6cdaabb1f1d76834c409045f64a89754a8bc3196579c92262755a9b217417901ff37d
7
- data.tar.gz: 2ee44300b3dfb57a5d35d23d698ded44979d1612dee1dc790f08946fdbc5ac1426fc86595684e107ffcdd95838fc69e15754483984a04e02e44f393b07e774a3
6
+ metadata.gz: d8be989f95a4651d4283b4770da33544bfe30d417b44d9de982fbf203a37e310cdb9cc7d3ebfe1be7d798bdc843ce9033762798f2bad2f5b62d6b09657cdbc4c
7
+ data.tar.gz: e57bed2000ed438e4ee2b543251f2757dd9fea2c8ad6d7d7aa93c9d9083c726e9fcc12c51eaa8bda2322ac12cb975d5c26e7bda34a922123561698e846f28f25
@@ -1,5 +1,6 @@
1
1
  ##2.0.2
2
2
  FIX:
3
+ - Terminate every input line by \n (BufferedReader does not)
3
4
  - Wrong input for type folder, leads to empty types
4
5
  ##2.0.1
5
6
  FIX:
@@ -25,6 +25,7 @@ java_import java.io.FileInputStream
25
25
  java_import java.io.BufferedReader
26
26
  java_import java.util.zip.GZIPInputStream
27
27
  java_import java.util.zip.ZipException
28
+ import java.lang.StringBuilder
28
29
 
29
30
  # our helper classes
30
31
  # these may go into this file for brevity...
@@ -326,6 +327,7 @@ class LogStash::Inputs::S3SNSSQS < LogStash::Inputs::Threadable
326
327
  if match = /#{s3_key_prefix}\/?(?<type_folder>.*?)\/.*/.match(key)
327
328
  return match['type_folder']
328
329
  else
330
+ #FIXME should be NIL instedt of empty sting?
329
331
  return ""
330
332
  end
331
333
  end
@@ -75,8 +75,7 @@ module LogProcessor
75
75
  @logger.warn("Problem while gzip detection", :error => e)
76
76
  end
77
77
 
78
- def read_file(filename, &block)
79
- #@logger.info("begin read_file",:thread => Thread.current[:name])
78
+ def read_file(filename)
80
79
  completed = false
81
80
  zipped = gzip?(filename)
82
81
  file_stream = FileInputStream.new(filename)
@@ -87,28 +86,23 @@ module LogProcessor
87
86
  decoder = InputStreamReader.new(file_stream, 'UTF-8')
88
87
  end
89
88
  buffered = BufferedReader.new(decoder)
90
- line = buffered.readLine()
91
- #@logger.info("read first line", :line => line)
92
- while (!line.nil?)
93
- block.call(line)
94
- line = buffered.readLine()
95
- #@logger.info("next line read",:line => line)
89
+
90
+ while (data = buffered.readLine())
91
+ line = StringBuilder.new(data).append("\n")
92
+ yield(line.toString())
96
93
  end
97
- #@logger.info("finished read_file",:thread => Thread.current[:name])
98
94
  completed = true
99
-
100
95
  rescue ZipException => e
101
96
  @logger.error("Gzip codec: We cannot uncompress the gzip file", :filename => filename, :error => e)
102
- return nil
103
97
  ensure
104
98
  buffered.close unless buffered.nil?
105
99
  decoder.close unless decoder.nil?
106
100
  gzip_stream.close unless gzip_stream.nil?
107
101
  file_stream.close unless file_stream.nil?
108
102
  throw :skip_delete unless completed
109
- return nil
110
103
  end
111
104
 
105
+
112
106
  def event_is_metadata?(event)
113
107
  return false unless event.get("message").class == String
114
108
  line = event.get("message")
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-s3-sns-sqs'
3
- s.version = '2.0.2'
3
+ s.version = '2.0.3'
4
4
  s.licenses = ['Apache-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"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-s3-sns-sqs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Herweg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-27 00:00:00.000000000 Z
11
+ date: 2019-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement