fluent-plugin-elb-access-log 0.1.2 → 0.1.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
  SHA1:
3
- metadata.gz: 21a7e6d462160d816a3dfe5da025c6fb1a00694d
4
- data.tar.gz: cb934a403a9f146836e33579bc6bccbcbd9f0d9e
3
+ metadata.gz: 693ada58a24f0ede7332179cb60e7575d93e3992
4
+ data.tar.gz: 07019ae76655f222c04d246ada18b9518e33bb22
5
5
  SHA512:
6
- metadata.gz: e42e25afeb0fc1960e924af399d0dae9b76aab989404ebc2f3731f49778761f4dc01cc0e18a20b82d8b39e18c27d586a9b49b4d6acd4085bc27c559307a1e305
7
- data.tar.gz: 6a75465ed44cdb3d39f65f67d489f2463eddb5252820fdba82800d8ca1362f0bd714b5c5af148830f2df670194882af253df9001ad1e7621f4f8d1192d13e85d
6
+ metadata.gz: 1b7175db9151c5f2b9095ee08cfb264e68b204a7ce28ecdf115f72ab130d069a10b0bb1e42ebc5b2855fb84d1d2c38a2483792f8fe0929bf089729a7990a1f4f
7
+ data.tar.gz: f7e1468f9af573261eb3ec8e2254a6d3d07828941874b1d750f6cc5c7edf35b2c32a50e773fe3e5e7a380382556c7fec2228c5fc7a7d7b8b6c317fe7623623b2
data/README.md CHANGED
@@ -33,8 +33,8 @@ Or install it yourself as:
33
33
  #http_proxy http://...
34
34
 
35
35
  account_id 123456789012 # required
36
+ region us-west-1 # required
36
37
  s3_bucket BUCKET_NAME # required
37
- s3_region us-west-1 # required
38
38
  #s3_prefix PREFIX
39
39
 
40
40
  #tag elb.access_log
@@ -81,4 +81,3 @@ Or install it yourself as:
81
81
  * It is possible to change the record tag.
82
82
  * List objects with prefix.
83
83
  * Perse request line URI.
84
- * It has tests other than the configuration file.
@@ -35,8 +35,8 @@ class Fluent::ElbAccessLogInput < Fluent::Input
35
35
  config_param :credentials_path, :string, :default => nil
36
36
  config_param :http_proxy, :string, :default => nil
37
37
  config_param :account_id, :string
38
+ config_param :region, :string
38
39
  config_param :s3_bucket, :string
39
- config_param :s3_region, :string
40
40
  config_param :s3_prefix, :string, :default => nil
41
41
  config_param :tag, :string, :default => 'elb.access_log'
42
42
  config_param :tsfile_path, :string, :default => '/var/tmp/fluent-plugin-elb-access-log.ts'
@@ -126,7 +126,7 @@ class Fluent::ElbAccessLogInput < Fluent::Input
126
126
  end
127
127
 
128
128
  def prefixes(timestamp)
129
- base_prefix = "AWSLogs/#{@account_id}/elasticloadbalancing/#{@s3_region}/"
129
+ base_prefix = "AWSLogs/#{@account_id}/elasticloadbalancing/#{@region}/"
130
130
  base_prefix = "#{@s3_prefix}/#{base_prefix}" if @s3_prefix
131
131
 
132
132
  [timestamp - 86400, timestamp, timestamp + 86400].map do |date|
@@ -1,3 +1,3 @@
1
1
  module FluentPluginElbAccessLog
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  describe 'Fluent::ElbAccessLogInput#configure' do
2
2
  let(:account_id) { '123456789012' }
3
3
  let(:s3_bucket) { 'my-bucket' }
4
- let(:s3_region) { 'us-west-1' }
4
+ let(:region) { 'us-west-1' }
5
5
  let(:driver) { create_driver(fluentd_conf) }
6
6
  let(:today) { Time.parse('2015/05/24 18:30 UTC') }
7
7
 
@@ -18,7 +18,7 @@ describe 'Fluent::ElbAccessLogInput#configure' do
18
18
  {
19
19
  account_id: account_id,
20
20
  s3_bucket: s3_bucket,
21
- s3_region: s3_region,
21
+ region: region,
22
22
  interval: nil,
23
23
  }
24
24
  end
@@ -30,7 +30,7 @@ describe 'Fluent::ElbAccessLogInput#configure' do
30
30
  expect(driver.instance.credentials_path).to be_nil
31
31
  expect(driver.instance.http_proxy).to be_nil
32
32
  expect(driver.instance.s3_bucket).to eq s3_bucket
33
- expect(driver.instance.s3_region).to eq s3_region
33
+ expect(driver.instance.region).to eq region
34
34
  expect(driver.instance.s3_prefix).to be_nil
35
35
  expect(driver.instance.tag).to eq 'elb.access_log'
36
36
  expect(driver.instance.tsfile_path).to eq '/var/tmp/fluent-plugin-elb-access-log.ts'
@@ -61,7 +61,7 @@ describe 'Fluent::ElbAccessLogInput#configure' do
61
61
  http_proxy: http_proxy,
62
62
  account_id: account_id,
63
63
  s3_bucket: s3_bucket,
64
- s3_region: s3_region,
64
+ region: region,
65
65
  s3_prefix: s3_prefix,
66
66
  tag: tag,
67
67
  tsfile_path: tsfile_path,
@@ -78,7 +78,7 @@ describe 'Fluent::ElbAccessLogInput#configure' do
78
78
  expect(driver.instance.credentials_path).to eq credentials_path
79
79
  expect(driver.instance.http_proxy).to eq http_proxy
80
80
  expect(driver.instance.s3_bucket).to eq s3_bucket
81
- expect(driver.instance.s3_region).to eq s3_region
81
+ expect(driver.instance.region).to eq region
82
82
  expect(driver.instance.s3_prefix).to eq s3_prefix
83
83
  expect(driver.instance.tag).to eq tag
84
84
  expect(driver.instance.tsfile_path).to eq tsfile_path
@@ -1,7 +1,7 @@
1
1
  describe Fluent::ElbAccessLogInput do
2
2
  let(:account_id) { '123456789012' }
3
3
  let(:s3_bucket) { 'my-bucket' }
4
- let(:s3_region) { 'us-west-1' }
4
+ let(:region) { 'us-west-1' }
5
5
  let(:driver) { create_driver(fluentd_conf) }
6
6
  let(:client){ Aws::S3::Client.new(stub_responses: true) }
7
7
 
@@ -9,7 +9,7 @@ describe Fluent::ElbAccessLogInput do
9
9
  {
10
10
  account_id: account_id,
11
11
  s3_bucket: s3_bucket,
12
- s3_region: s3_region,
12
+ region: region,
13
13
  start_datetime: (today - 1).to_s,
14
14
  }
15
15
  end
@@ -18,9 +18,9 @@ describe Fluent::ElbAccessLogInput do
18
18
  let(:yesterday) { today - 86400 }
19
19
  let(:tomorrow) { today + 86400 }
20
20
 
21
- let(:today_prefix) { "AWSLogs/#{account_id}/elasticloadbalancing/#{s3_region}/#{today.strftime('%Y/%m/%d')}/" }
22
- let(:yesterday_prefix) { "AWSLogs/#{account_id}/elasticloadbalancing/#{s3_region}/#{yesterday.strftime('%Y/%m/%d')}/" }
23
- let(:tomorrow_prefix) { "AWSLogs/#{account_id}/elasticloadbalancing/#{s3_region}/#{tomorrow.strftime('%Y/%m/%d')}/" }
21
+ let(:today_prefix) { "AWSLogs/#{account_id}/elasticloadbalancing/#{region}/#{today.strftime('%Y/%m/%d')}/" }
22
+ let(:yesterday_prefix) { "AWSLogs/#{account_id}/elasticloadbalancing/#{region}/#{yesterday.strftime('%Y/%m/%d')}/" }
23
+ let(:tomorrow_prefix) { "AWSLogs/#{account_id}/elasticloadbalancing/#{region}/#{tomorrow.strftime('%Y/%m/%d')}/" }
24
24
 
25
25
  let(:today_object_key) { "#{today_prefix}#{account_id}_elasticloadbalancing_ap-northeast-1_hoge_#{today.iso8601}_52.68.51.1_8hSqR3o4.log" }
26
26
  let(:yesterday_object_key) { "#{yesterday_prefix}#{account_id}_elasticloadbalancing_ap-northeast-1_hoge_#{yesterday.iso8601}_52.68.51.1_8hSqR3o4.log" }
@@ -221,7 +221,7 @@ describe Fluent::ElbAccessLogInput do
221
221
  {
222
222
  account_id: account_id,
223
223
  s3_bucket: s3_bucket,
224
- s3_region: s3_region,
224
+ region: region,
225
225
  start_datetime: (today - 1).to_s,
226
226
  tag: 'any.tag'
227
227
  }
data/spec/spec_helper.rb CHANGED
@@ -21,7 +21,7 @@ def create_driver(options = {})
21
21
 
22
22
  account_id = options.fetch(:account_id) || '123456789012'
23
23
  s3_bucket = options.fetch(:s3_bucket) || 'my-bucket'
24
- s3_region = options.fetch(:s3_region) || 'us-west-1'
24
+ region = options.fetch(:region) || 'us-west-1'
25
25
 
26
26
  additional_options = options.select {|k, v| v }.map {|key, value|
27
27
  "#{key} #{value}"
@@ -31,7 +31,7 @@ def create_driver(options = {})
31
31
  type elb_access_log
32
32
  account_id #{account_id}
33
33
  s3_bucket #{s3_bucket}
34
- s3_region #{s3_region}
34
+ region #{region}
35
35
  #{additional_options}
36
36
  EOS
37
37
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-elb-access-log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-24 00:00:00.000000000 Z
11
+ date: 2015-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd