logstash-output-s3 2.0.3 → 2.0.4

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
  SHA1:
3
- metadata.gz: 2a57c037d6627ceef970653cd8a19a581def6923
4
- data.tar.gz: f21a889e3ab2e29393b2e848fb6a7cef8066fcc3
3
+ metadata.gz: 912a056e6b1dffd2e3c976f200e51a6c3d9054ba
4
+ data.tar.gz: d827ee7682d89fcb9ee7bdb0eadd633d9753c6d8
5
5
  SHA512:
6
- metadata.gz: ce36c4818f471e7ce22a32aa29339f2dc73c7399f707237c77ec03d194c57bb5ef2ffc47bb0dd653fe858963f794212afb8c7419960399cc27367719d58c2215
7
- data.tar.gz: 057be1da44425b0c8f082f694e2f06d33aec99f98d22dea50a7d80e698ee636c90e103d9478f15073eacfa84c2149900d1d5787aaec98dc1a50f978dd365619a
6
+ metadata.gz: 645a2f61ca39cc11f0fabdc07ff17d7da93235d266432f7054b6cba21a1179771dea86b7d05ace8ee2d4d53d91f9896d0d7ae2c2d64513b648c8e1f7aecf72d5
7
+ data.tar.gz: 0b3b177b072a3c3348e9901880f7564bcdfd03eace46c2d3278ba8ac38938d3bc77cffcca8e68d05ddd1f27a6ef540c0cbf78e374591dea12c22d4cc31e105f6
@@ -1,3 +1,6 @@
1
+ ## 2.0.4
2
+ - Remove the `Time.now` stub in the spec, it was conflicting with other test when running inside the default plugins test #63
3
+ - Make the spec run faster by adjusting the values of time rotation test.
1
4
  ## 2.0.2
2
5
  - Fixes an issue when tags were defined #39
3
6
  ## 2.0.0
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Logstash Plugin
2
2
 
3
+ [![Build
4
+ Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Outputs/job/logstash-plugin-output-s3-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Outputs/job/logstash-plugin-output-s3-unit/)
5
+
3
6
  This is a plugin for [Logstash](https://github.com/elastic/logstash).
4
7
 
5
8
  It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
@@ -58,7 +58,6 @@ require "fileutils"
58
58
  # bucket => "boss_please_open_your_bucket" (required)
59
59
  # size_file => 2048 (optional)
60
60
  # time_file => 5 (optional)
61
- # format => "plain" (optional)
62
61
  # canned_acl => "private" (optional. Options are "private", "public_read", "public_read_write", "authenticated_read". Defaults to "private" )
63
62
  # }
64
63
  #
@@ -117,7 +116,7 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
117
116
  #
118
117
  # Will generate this file:
119
118
  # "ls.s3.logstash.local.2015-01-01T00.00.tag_elasticsearch.logstash.kibana.part0.txt"
120
- #
119
+ #
121
120
  config :tags, :validate => :array, :default => []
122
121
 
123
122
  # Exposed attributes for testing purpose.
@@ -133,7 +132,7 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
133
132
  def aws_service_endpoint(region)
134
133
  # Make the deprecated endpoint_region work
135
134
  # TODO: (ph) Remove this after deprecation.
136
-
135
+
137
136
  if @endpoint_region
138
137
  region_to_use = @endpoint_region
139
138
  else
@@ -240,7 +239,7 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
240
239
  File.delete(test_filename)
241
240
  end
242
241
  end
243
-
242
+
244
243
  public
245
244
  def restore_from_crashes
246
245
  @logger.debug("S3: is attempting to verify previous crashes...")
@@ -288,7 +287,7 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
288
287
 
289
288
  public
290
289
  def receive(event)
291
-
290
+
292
291
  @codec.encode(event)
293
292
  end
294
293
 
@@ -346,7 +345,7 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
346
345
  else
347
346
  @logger.debug("S3: tempfile file size report.", :tempfile_size => @tempfile.size, :size_file => @size_file)
348
347
  end
349
- end
348
+ end
350
349
 
351
350
  write_to_tempfile(encoded_event)
352
351
  end
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-s3'
4
- s.version = '2.0.3'
4
+ s.version = '2.0.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "This plugin was created for store the logstash's events into Amazon Simple Storage Service (Amazon S3)"
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/plugin install gemname. This gem is not a stand-alone program"
@@ -70,24 +70,23 @@ describe LogStash::Outputs::S3 do
70
70
  describe "#generate_temporary_filename" do
71
71
  before do
72
72
  allow(Socket).to receive(:gethostname) { "logstash.local" }
73
- allow(Time).to receive(:now) { Time.new('2015-10-09-09:00') }
74
73
  end
75
74
 
76
75
  it "should add tags to the filename if present" do
77
76
  config = minimal_settings.merge({ "tags" => ["elasticsearch", "logstash", "kibana"], "temporary_directory" => "/tmp/logstash"})
78
77
  s3 = LogStash::Outputs::S3.new(config)
79
- expect(s3.get_temporary_filename).to eq("ls.s3.logstash.local.2015-01-01T00.00.tag_elasticsearch.logstash.kibana.part0.txt")
78
+ expect(s3.get_temporary_filename).to match(/^ls\.s3\.logstash\.local\.\d{4}-\d{2}\-\d{2}T\d{2}\.\d{2}\.tag_#{config["tags"].join("\.")}\.part0\.txt\Z/)
80
79
  end
81
80
 
82
81
  it "should not add the tags to the filename" do
83
82
  config = minimal_settings.merge({ "tags" => [], "temporary_directory" => "/tmp/logstash" })
84
83
  s3 = LogStash::Outputs::S3.new(config)
85
- expect(s3.get_temporary_filename(3)).to eq("ls.s3.logstash.local.2015-01-01T00.00.part3.txt")
84
+ expect(s3.get_temporary_filename(3)).to match(/^ls\.s3\.logstash\.local\.\d{4}-\d{2}\-\d{2}T\d{2}\.\d{2}\.part3\.txt\Z/)
86
85
  end
87
86
 
88
87
  it "normalized the temp directory to include the trailing slash if missing" do
89
88
  s3 = LogStash::Outputs::S3.new(minimal_settings.merge({ "temporary_directory" => "/tmp/logstash" }))
90
- expect(s3.get_temporary_filename).to eq("ls.s3.logstash.local.2015-01-01T00.00.part0.txt")
89
+ expect(s3.get_temporary_filename).to match(/^ls\.s3\.logstash\.local\.\d{4}-\d{2}\-\d{2}T\d{2}\.\d{2}\.part0\.txt\Z/)
91
90
  end
92
91
  end
93
92
 
@@ -303,8 +302,8 @@ describe LogStash::Outputs::S3 do
303
302
 
304
303
  it "doesn't skip events if using the time_file option", :tag => :slow do
305
304
  Stud::Temporary.directory do |temporary_directory|
306
- time_file = rand(5..10)
307
- number_of_rotation = rand(4..10)
305
+ time_file = rand(1..2)
306
+ number_of_rotation = rand(2..5)
308
307
 
309
308
  config = {
310
309
  "time_file" => time_file,
@@ -315,7 +314,7 @@ describe LogStash::Outputs::S3 do
315
314
 
316
315
  s3 = LogStash::Outputs::S3.new(minimal_settings.merge(config))
317
316
  # Make the test run in seconds intead of minutes..
318
- allow(s3).to receive(:periodic_interval).and_return(time_file)
317
+ expect(s3).to receive(:periodic_interval).and_return(time_file)
319
318
  s3.register
320
319
 
321
320
  # Force to have a few files rotation
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: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-14 00:00:00.000000000 Z
11
+ date: 2015-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 2.4.8
143
+ rubygems_version: 2.4.5
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: This plugin was created for store the logstash's events into Amazon Simple Storage Service (Amazon S3)