fluent-plugin-s3 0.8.1 → 0.8.2
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 +5 -0
- data/VERSION +1 -1
- data/lib/fluent/log-ext.rb +12 -0
- data/lib/fluent/plugin/in_s3.rb +15 -0
- data/lib/fluent/plugin/out_s3.rb +5 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cc0288cd0570f9a9d1126c0902ce9c433c35cbf
|
4
|
+
data.tar.gz: 0e43079cda29f9319892c23e1eb5beea722dc714
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2765df3ba45b91b809b12deb008d77a83e581c71858ef26b8afb351d0d476246fb3020c9505cf39da2d508e5008a8f5e7a4ce955734144b8f31e417e877fbb3
|
7
|
+
data.tar.gz: c1390e6687f6b024f265776f2e4882151741b450bc1e04d7c5f0bda276a8da06ac1e0ad975785e53e181b10db79a03735c69ae71c636cb7b2af8c0517b54f9e9
|
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.2
|
data/lib/fluent/plugin/in_s3.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'fluent/input'
|
2
|
+
require 'fluent/log-ext'
|
2
3
|
|
3
4
|
module Fluent
|
4
5
|
class S3Input < Input
|
@@ -109,6 +110,8 @@ module Fluent
|
|
109
110
|
super
|
110
111
|
|
111
112
|
s3_client = create_s3_client
|
113
|
+
|
114
|
+
log.debug("Succeeded to create S3 client")
|
112
115
|
@s3 = Aws::S3::Resource.new(:client => s3_client)
|
113
116
|
@bucket = @s3.bucket(@s3_bucket)
|
114
117
|
|
@@ -117,8 +120,10 @@ module Fluent
|
|
117
120
|
check_apikeys if @check_apikey_on_start
|
118
121
|
|
119
122
|
sqs_client = create_sqs_client
|
123
|
+
log.debug("Succeeded to create SQS client")
|
120
124
|
response = sqs_client.get_queue_url(queue_name: @sqs.queue_name)
|
121
125
|
sqs_queue_url = response.queue_url
|
126
|
+
log.debug("Succeeded to get SQS queue URL")
|
122
127
|
|
123
128
|
@poller = Aws::SQS::QueuePoller.new(sqs_queue_url, client: sqs_client)
|
124
129
|
|
@@ -144,6 +149,7 @@ module Fluent
|
|
144
149
|
@poller.poll(options) do |message|
|
145
150
|
begin
|
146
151
|
body = Yajl.load(message.body)
|
152
|
+
log.debug(body)
|
147
153
|
next unless body["Records"] # skip test queue
|
148
154
|
|
149
155
|
process(body)
|
@@ -194,6 +200,10 @@ module Fluent
|
|
194
200
|
options = setup_credentials
|
195
201
|
options[:region] = @s3_region if @s3_region
|
196
202
|
options[:proxy_uri] = @proxy_uri if @proxy_uri
|
203
|
+
log.on_trace do
|
204
|
+
options[:http_wire_trace] = true
|
205
|
+
options[:logger] = log
|
206
|
+
end
|
197
207
|
|
198
208
|
Aws::S3::Client.new(options)
|
199
209
|
end
|
@@ -201,12 +211,17 @@ module Fluent
|
|
201
211
|
def create_sqs_client
|
202
212
|
options = setup_credentials
|
203
213
|
options[:region] = @s3_region if @s3_region
|
214
|
+
log.on_trace do
|
215
|
+
options[:http_wire_trace] = true
|
216
|
+
options[:logger] = log
|
217
|
+
end
|
204
218
|
|
205
219
|
Aws::SQS::Client.new(options)
|
206
220
|
end
|
207
221
|
|
208
222
|
def check_apikeys
|
209
223
|
@bucket.objects.first
|
224
|
+
log.debug("Succeeded to verify API keys")
|
210
225
|
rescue => e
|
211
226
|
raise "can't call S3 API. Please check your aws_key_id / aws_sec_key or s3_region configuration. error = #{e.inspect}"
|
212
227
|
end
|
data/lib/fluent/plugin/out_s3.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'fluent/output'
|
2
|
+
require 'fluent/log-ext'
|
2
3
|
|
3
4
|
module Fluent
|
4
5
|
class S3Output < Fluent::TimeSlicedOutput
|
@@ -177,6 +178,10 @@ module Fluent
|
|
177
178
|
options[:compute_checksums] = @compute_checksums unless @compute_checksums.nil?
|
178
179
|
options[:signature_version] = @signature_version unless @signature_version.nil?
|
179
180
|
options[:ssl_verify_peer] = @ssl_verify_peer
|
181
|
+
log.on_trace do
|
182
|
+
options[:http_wire_trace] = true
|
183
|
+
options[:logger] = log
|
184
|
+
end
|
180
185
|
|
181
186
|
s3_client = Aws::S3::Client.new(options)
|
182
187
|
@s3 = Aws::S3::Resource.new(:client => s3_client)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-01
|
12
|
+
date: 2017-03-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- VERSION
|
139
139
|
- appveyor.yml
|
140
140
|
- fluent-plugin-s3.gemspec
|
141
|
+
- lib/fluent/log-ext.rb
|
141
142
|
- lib/fluent/plugin/in_s3.rb
|
142
143
|
- lib/fluent/plugin/out_s3.rb
|
143
144
|
- lib/fluent/plugin/s3_compressor_gzip_command.rb
|
@@ -168,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
169
|
version: '0'
|
169
170
|
requirements: []
|
170
171
|
rubyforge_project:
|
171
|
-
rubygems_version: 2.
|
172
|
+
rubygems_version: 2.6.8
|
172
173
|
signing_key:
|
173
174
|
specification_version: 4
|
174
175
|
summary: Amazon S3 output plugin for Fluentd event collector
|