logstash-output-s3 2.0.7 → 3.0.0

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: 80e75152fb124d5936f0fd110072509a69845f52
4
- data.tar.gz: 407179b921a6f00a8ea5357d39db6f12525e87e7
3
+ metadata.gz: 6c4f5b3ad0556699be1a0cc4f99e3c7e96e350d8
4
+ data.tar.gz: 6274f98e488cc9545c510a974c994e0a71060d92
5
5
  SHA512:
6
- metadata.gz: a7a5a417febef05d0f6591f93d1ce3a9192ed327729f1296736c43fb5570b41412c6cf0aefc3215a4fcd88e8faf4cfedb2e8cbbe8cd19d61e0038890c674dda9
7
- data.tar.gz: f9446f247c8a768367a6df7c0829d5cd8471724f1a329b3c75297c03e76f0421b2155cb17401060a6dfc7adbf28dcca983ba936f3eda44eee1e68dca1363c6a1
6
+ metadata.gz: 21690767ece4c415ac215807faa58aa127e617368fde426a0fe25d5b78cad4b3467eca8879ffa6f269205640da2e5dddec0ee007bc086550cc3d33ed71bfd173
7
+ data.tar.gz: 318ab7c8009dd314e2b26f43746437027a14cf517abe5051faefb0c7e156fe59572578e9d7d9c21c2d431a30e0905bce49193bcf647d62dad02196ecfe258637
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ ## 3.0.0
2
+ - Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141
1
3
  # 2.0.7
2
4
  - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
3
5
  # 2.0.6
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
1
  source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in logstash-mass_effect.gemspec
2
4
  gemspec
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012–2015 Elasticsearch <http://www.elastic.co>
1
+ Copyright (c) 2012–2016 Elasticsearch <http://www.elastic.co>
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -1,7 +1,6 @@
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/)
3
+ [![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-output-s3.svg)](https://travis-ci.org/logstash-plugins/logstash-output-s3)
5
4
 
6
5
  This is a plugin for [Logstash](https://github.com/elastic/logstash).
7
6
 
@@ -56,7 +55,12 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
56
55
  ```
57
56
  - Install plugin
58
57
  ```sh
58
+ # Logstash 2.3 and higher
59
+ bin/logstash-plugin install --no-verify
60
+
61
+ # Prior to Logstash 2.3
59
62
  bin/plugin install --no-verify
63
+
60
64
  ```
61
65
  - Run Logstash with your plugin
62
66
  ```sh
@@ -74,7 +78,12 @@ gem build logstash-filter-awesome.gemspec
74
78
  ```
75
79
  - Install the plugin from the Logstash home
76
80
  ```sh
77
- bin/plugin install /your/local/plugin/logstash-filter-awesome.gem
81
+ # Logstash 2.3 and higher
82
+ bin/logstash-plugin install --no-verify
83
+
84
+ # Prior to Logstash 2.3
85
+ bin/plugin install --no-verify
86
+
78
87
  ```
79
88
  - Start Logstash and proceed to test the plugin
80
89
 
@@ -12,13 +12,16 @@ require "fileutils"
12
12
 
13
13
  # INFORMATION:
14
14
  #
15
- # This plugin sends logstash events to Amazon Simple Storage Service (Amazon S3).
16
- # To use it you need to have the proper write premissions and a valid s3 bucket.
17
- # Make sure you have permissions to write files on S3's bucket. Also be sure to run logstash as super user to establish a connection.
15
+ # This plugin batches and uploads logstash events into Amazon Simple Storage Service (Amazon S3).
16
+ #
17
+ # Requirements:
18
+ # * Amazon S3 Bucket and S3 Access Permissions (Typically access_key_id and secret_access_key)
19
+ # * S3 PutObject permission
20
+ # * Run logstash as superuser to establish connection
18
21
  #
22
+ # S3 outputs create temporary files into "/opt/logstash/S3_temp/". If you want, you can change the path at the start of register method.
19
23
  #
20
- # This plugin outputs temporary files to "/opt/logstash/S3_temp/". If you want, you can change the path at the start of register method.
21
- # These files have a special name, for example:
24
+ # S3 output files have the following format
22
25
  #
23
26
  # ls.s3.ip-10-228-27-95.2013-04-18T10.00.tag_hello.part0.txt
24
27
  #
@@ -28,23 +31,28 @@ require "fileutils"
28
31
  # "2013-04-18T10.00" : represents the time whenever you specify time_file.
29
32
  # "tag_hello" : this indicates the event's tag.
30
33
  # "part0" : this means if you indicate size_file then it will generate more parts if you file.size > size_file.
31
- # When a file is full it will be pushed to a bucket and will be deleted from the temporary directory.
32
- # If a file is empty is not pushed, it is not deleted.
34
+ # When a file is full it will be pushed to the bucket and then deleted from the temporary directory.
35
+ # If a file is empty, it is simply deleted. Empty files will not be pushed
33
36
  #
34
- # This plugin have a system to restore the previous temporary files if something crash.
37
+ # Crash Recovery:
38
+ # * This plugin will recover and upload temporary log files after crash/abnormal termination
35
39
  #
36
- ##[Note] :
40
+ ##[Note regarding time_file and size_file] :
37
41
  #
38
- ## If you specify size_file and time_file then it will create file for each tag (if specified), when time_file or
39
- ## their size > size_file, it will be triggered then they will be pushed on s3's bucket and will delete from local disk.
40
- ## If you don't specify size_file, but time_file then it will create only one file for each tag (if specified).
41
- ## When time_file it will be triggered then the files will be pushed on s3's bucket and delete from local disk.
42
+ # Both time_file and size_file settings can trigger a log "file rotation"
43
+ # A log rotation pushes the current log "part" to s3 and deleted from local temporary storage.
42
44
  #
43
- ## If you don't specify time_file, but size_file then it will create files for each tag (if specified),
44
- ## that will be triggered when their size > size_file, then they will be pushed on s3's bucket and will delete from local disk.
45
+ ## If you specify BOTH size_file and time_file then it will create file for each tag (if specified).
46
+ ## When EITHER time_file minutes have elapsed OR log file size > size_file, a log rotation is triggered.
47
+ ##
48
+ ## If you ONLY specify time_file but NOT file_size, one file for each tag (if specified) will be created..
49
+ ## When time_file minutes elapses, a log rotation will be triggered.
45
50
  #
46
- ## If you don't specific size_file and time_file you have a curios mode. It will create only one file for each tag (if specified).
47
- ## Then the file will be rest on temporary directory and don't will be pushed on bucket until we will restart logstash.
51
+ ## If you ONLY specify size_file, but NOT time_file, one files for each tag (if specified) will be created.
52
+ ## When size of log file part > size_file, a log rotation will be triggered.
53
+ #
54
+ ## If NEITHER size_file nor time_file is specified, ONLY one file for each tag (if specified) will be created.
55
+ ## WARNING: Since no log rotation is triggered, S3 Upload will only occur when logstash restarts.
48
56
  #
49
57
  #
50
58
  # #### Usage:
@@ -54,10 +62,11 @@ require "fileutils"
54
62
  # s3{
55
63
  # access_key_id => "crazy_key" (required)
56
64
  # secret_access_key => "monkey_access_key" (required)
57
- # endpoint_region => "eu-west-1" (required)
65
+ # endpoint_region => "eu-west-1" (required) - Deprecated
58
66
  # bucket => "boss_please_open_your_bucket" (required)
59
- # size_file => 2048 (optional)
60
- # time_file => 5 (optional)
67
+ # size_file => 2048 (optional) - Bytes
68
+ # time_file => 5 (optional) - Minutes
69
+ # format => "plain" (optional)
61
70
  # canned_acl => "private" (optional. Options are "private", "public_read", "public_read_write", "authenticated_read". Defaults to "private" )
62
71
  # }
63
72
  #
@@ -83,7 +92,7 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
83
92
  ##NOTE: define size of file is the better thing, because generate a local temporary file on disk and then put it in bucket.
84
93
  config :size_file, :validate => :number, :default => 0
85
94
 
86
- # Set the time, in minutes, to close the current sub_time_section of bucket.
95
+ # Set the time, in MINUTES, to close the current sub_time_section of bucket.
87
96
  # If you define file_size you have a number of files in consideration of the section and the current tag.
88
97
  # 0 stay all time on listerner, beware if you specific 0 and size_file 0, because you will not put the file on bucket,
89
98
  # for now the only thing this plugin can do is to put the file when logstash restart.
@@ -99,11 +108,14 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
99
108
  config :canned_acl, :validate => ["private", "public_read", "public_read_write", "authenticated_read"],
100
109
  :default => "private"
101
110
 
111
+ # Specifies wether or not to use S3's AES256 server side encryption. Defaults to false.
112
+ config :server_side_encryption, :validate => :boolean, :default => false
113
+
102
114
  # Set the directory where logstash will store the tmp files before sending it to S3
103
115
  # default to the current OS temporary directory in linux /tmp/logstash
104
116
  config :temporary_directory, :validate => :string, :default => File.join(Dir.tmpdir, "logstash")
105
117
 
106
- # Specify a prefix to the uploaded filename, this can simulate directories on S3
118
+ # Specify a prefix to the uploaded filename, this can simulate directories on S3. Prefix does not require leading slash.
107
119
  config :prefix, :validate => :string, :default => ''
108
120
 
109
121
  # Specify how many workers to use to upload the files to S3
@@ -173,7 +185,7 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
173
185
  begin
174
186
  # prepare for write the file
175
187
  object = bucket.objects[remote_filename]
176
- object.write(fileIO, :acl => @canned_acl)
188
+ object.write(fileIO, :acl => @canned_acl, :server_side_encryption => @server_side_encryption ? :aes256 : nil)
177
189
  rescue AWS::Errors::Base => error
178
190
  @logger.error("S3: AWS error", :error => error)
179
191
  raise LogStash::Error, "AWS Configuration Error, #{error}"
@@ -258,11 +270,11 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
258
270
 
259
271
  public
260
272
  def restore_from_crashes
261
- @logger.debug("S3: is attempting to verify previous crashes...")
273
+ @logger.debug("S3: Checking for temp files from a previoius crash...")
262
274
 
263
275
  Dir[File.join(@temporary_directory, "*.#{TEMPFILE_EXTENSION}")].each do |file|
264
276
  name_file = File.basename(file)
265
- @logger.warn("S3: have found temporary file the upload process crashed, uploading file to S3.", :filename => name_file)
277
+ @logger.warn("S3: Found temporary file from crash. Uploading file to S3.", :filename => name_file)
266
278
  move_file_to_bucket_async(file)
267
279
  end
268
280
  end
@@ -271,7 +283,7 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
271
283
  def move_file_to_bucket(file)
272
284
  if !File.zero?(file)
273
285
  write_on_bucket(file)
274
- @logger.debug("S3: file was put on the upload thread", :filename => File.basename(file), :bucket => @bucket)
286
+ @logger.debug("S3: File was put on the upload thread", :filename => File.basename(file), :bucket => @bucket)
275
287
  end
276
288
 
277
289
  begin
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-s3'
4
- s.version = '2.0.7'
4
+ s.version = '3.0.0'
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
- 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"
7
+ 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"
8
8
  s.authors = ["Elastic"]
9
9
  s.email = 'info@elastic.co'
10
10
  s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" }
21
21
 
22
22
  # Gem dependencies
23
- s.add_runtime_dependency "logstash-core-plugin-api", "~> 1.0"
23
+ s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
24
24
  s.add_runtime_dependency 'logstash-mixin-aws'
25
25
  s.add_runtime_dependency 'stud', '~> 0.0.22'
26
26
  s.add_development_dependency 'logstash-devutils'
metadata CHANGED
@@ -1,100 +1,102 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2016-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: logstash-core-plugin-api
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - "~>"
17
18
  - !ruby/object:Gem::Version
18
- version: '1.0'
19
- name: logstash-core-plugin-api
20
- prerelease: false
19
+ version: '2.0'
21
20
  type: :runtime
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
+ name: logstash-mixin-aws
28
29
  requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
31
  - - ">="
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
- name: logstash-mixin-aws
34
- prerelease: false
35
34
  type: :runtime
35
+ prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
+ name: stud
42
43
  requirement: !ruby/object:Gem::Requirement
43
44
  requirements:
44
45
  - - "~>"
45
46
  - !ruby/object:Gem::Version
46
47
  version: 0.0.22
47
- name: stud
48
- prerelease: false
49
48
  type: :runtime
49
+ prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.0.22
55
55
  - !ruby/object:Gem::Dependency
56
+ name: logstash-devutils
56
57
  requirement: !ruby/object:Gem::Requirement
57
58
  requirements:
58
59
  - - ">="
59
60
  - !ruby/object:Gem::Version
60
61
  version: '0'
61
- name: logstash-devutils
62
- prerelease: false
63
62
  type: :development
63
+ prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
+ name: logstash-input-generator
70
71
  requirement: !ruby/object:Gem::Requirement
71
72
  requirements:
72
73
  - - ">="
73
74
  - !ruby/object:Gem::Version
74
75
  version: '0'
75
- name: logstash-input-generator
76
- prerelease: false
77
76
  type: :development
77
+ prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
+ name: logstash-codec-line
84
85
  requirement: !ruby/object:Gem::Requirement
85
86
  requirements:
86
87
  - - ">="
87
88
  - !ruby/object:Gem::Version
88
89
  version: '0'
89
- name: logstash-codec-line
90
- prerelease: false
91
90
  type: :development
91
+ prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- 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
97
+ description: This gem is a Logstash plugin required to be installed on top of the
98
+ Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
99
+ gem is not a stand-alone program
98
100
  email: info@elastic.co
99
101
  executables: []
100
102
  extensions: []
@@ -118,7 +120,7 @@ licenses:
118
120
  metadata:
119
121
  logstash_plugin: 'true'
120
122
  logstash_group: output
121
- post_install_message:
123
+ post_install_message:
122
124
  rdoc_options: []
123
125
  require_paths:
124
126
  - lib
@@ -133,11 +135,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
135
  - !ruby/object:Gem::Version
134
136
  version: '0'
135
137
  requirements: []
136
- rubyforge_project:
137
- rubygems_version: 2.4.8
138
- signing_key:
138
+ rubyforge_project:
139
+ rubygems_version: 2.5.1
140
+ signing_key:
139
141
  specification_version: 4
140
- summary: This plugin was created for store the logstash's events into Amazon Simple Storage Service (Amazon S3)
142
+ summary: This plugin was created for store the logstash's events into Amazon Simple
143
+ Storage Service (Amazon S3)
141
144
  test_files:
142
145
  - spec/integration/s3_spec.rb
143
146
  - spec/outputs/s3_spec.rb