logstash-output-s3 4.0.5 → 4.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31a45d07d1d55ba2247ea058ca57be461f7773d9
4
- data.tar.gz: c45f5e22b868918990ef27f5c2d2b1682f7ad93e
3
+ metadata.gz: d62c917fb80e5d23d3805867be54c62391c9d118
4
+ data.tar.gz: ded80a07e55c538ad48da433dc2cd5cb07509f5e
5
5
  SHA512:
6
- metadata.gz: d05449f29cd48dbbf75372bae6a2b4a6722b23b34e3653f435f1edf49ee56caa473dc52972a4812888b600f8055c98b08ec4002f887cd38646941ffe05814887
7
- data.tar.gz: 63ec9d6444fc8046aeaf05d81a7ea2a2e6e05b9d986538713d7e3357aa430ee1d3f6f49a7ae0ab15f1dd4950767aa8e13e8e1b8be72205167b132596f8348492
6
+ metadata.gz: fd6617e4be2b6c0abb035c96e21c1a99141bcb66a6f764c6168c34c6762d3bbfac096956ef570759fde88e787f867c5a96ff9d203836af1a5491fc395e4e3386
7
+ data.tar.gz: 0def00c7a109bb34a07ef2e96ffe6c017dcf0fdec5329e5432497264d7261a18d4cfa71390e0047c5f3f47cf383246bc609aeef4d6c27c7922af779a55822d29
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 4.0.6
2
+ - Fix: Use the right `signature_version` for the SDK v2 #129
3
+ - Fix an issue to prevent the output to upload empty file to S3 #128
4
+ - Docs: Update the doc to show the new format of the remote file #126
5
+
1
6
  ## 4.0.5
2
7
  - Delete the file on disk after they are succesfully uploaded to S3 #122 #120
3
8
  - Added logging when an exception occur in the Uploader's `on_complete` callback
data/CONTRIBUTORS CHANGED
@@ -2,6 +2,7 @@ The following is a list of people who have contributed ideas, code, bug
2
2
  reports, or in general have helped logstash along its way.
3
3
 
4
4
  Contributors:
5
+ * Chad Bean (chadbean)
5
6
  * Colin Surprenant (colinsurprenant)
6
7
  * Helmut Duregger (hduregger)
7
8
  * Jordan Sissel (jordansissel)
@@ -28,12 +28,12 @@ Aws.eager_autoload!
28
28
  #
29
29
  # S3 output files have the following format
30
30
  #
31
- # ls.s3.ip-10-228-27-95.2013-04-18T10.00.tag_hello.part0.txt
31
+ # ls.s3.312bc026-2f5d-49bc-ae9f-5940cf4ad9a6.2013-04-18T10.00.tag_hello.part0.txt
32
32
  #
33
33
  #
34
34
  # |=======
35
35
  # | ls.s3 | indicate logstash plugin s3 |
36
- # | ip-10-228-27-95 | indicates the ip of your machine. |
36
+ # | 312bc026-2f5d-49bc-ae9f-5940cf4ad9a6 | a new, random uuid per file. |
37
37
  # | 2013-04-18T10.00 | represents the time whenever you specify time_file. |
38
38
  # | tag_hello | this indicates the event's tag. |
39
39
  # | part0 | this means if you indicate size_file then it will generate more parts if you file.size > size_file. When a file is full it will be pushed to the bucket and then deleted from the temporary directory. If a file is empty, it is simply deleted. Empty files will not be pushed |
@@ -268,7 +268,7 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
268
268
 
269
269
  def full_options
270
270
  options = Hash.new
271
- options[:s3_signature_version] = @signature_version if @signature_version
271
+ options[:signature_version] = @signature_version if @signature_version
272
272
  options.merge(aws_options_hash)
273
273
  end
274
274
 
@@ -109,8 +109,14 @@ module LogStash
109
109
 
110
110
  def size
111
111
  # to get the current file size
112
- @gzip_writer.flush
113
- @gzip_writer.to_io.size
112
+ if @gzip_writer.pos == 0
113
+ # Ensure a zero file size is returned when nothing has
114
+ # yet been written to the gzip file.
115
+ 0
116
+ else
117
+ @gzip_writer.flush
118
+ @gzip_writer.to_io.size
119
+ end
114
120
  end
115
121
 
116
122
  def fsync
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-s3'
3
- s.version = '4.0.5'
3
+ s.version = '4.0.6'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = "This plugin was created for store the logstash's events into Amazon Simple Storage Service (Amazon S3)"
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/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -20,6 +20,10 @@ describe LogStash::Outputs::S3::TemporaryFileFactory do
20
20
  expect(File.exist?(subject.current.path)).to be_truthy
21
21
  end
22
22
 
23
+ it "returns a size equal to zero after file creation" do
24
+ expect(subject.current.size).to eq(0)
25
+ end
26
+
23
27
  it "create a temporary file when initialized" do
24
28
  expect(subject.current).to be_kind_of(LogStash::Outputs::S3::TemporaryFile)
25
29
  end
@@ -33,13 +33,13 @@ describe LogStash::Outputs::S3 do
33
33
  it "should set the signature version if specified" do
34
34
  ["v2", "v4"].each do |version|
35
35
  s3 = described_class.new(options.merge({ "signature_version" => version }))
36
- expect(s3.full_options).to include(:s3_signature_version => version)
36
+ expect(s3.full_options).to include(:signature_version => version)
37
37
  end
38
38
  end
39
39
 
40
40
  it "should omit the option completely if not specified" do
41
41
  s3 = described_class.new(options)
42
- expect(s3.full_options.has_key?(:s3_signature_version)).to eql(false)
42
+ expect(s3.full_options.has_key?(:signature_version)).to eql(false)
43
43
  end
44
44
  end
45
45
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.5
4
+ version: 4.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-18 00:00:00.000000000 Z
11
+ date: 2017-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement