fluent-plugin-elb-access-log 0.4.4 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +3 -0
- data/Appraisals +7 -0
- data/fluent-plugin-elb-access-log.gemspec +2 -1
- data/gemfiles/fluentd_0.12.gemfile +7 -0
- data/gemfiles/fluentd_0.14.gemfile +7 -0
- data/lib/fluent/plugin/in_elb_access_log.rb +2 -2
- data/lib/fluent_plugin_elb_access_log/version.rb +1 -1
- data/spec/in_elb_access_log_alb_spec.rb +4 -4
- data/spec/in_elb_access_log_clb_spec.rb +4 -4
- data/spec/in_elb_access_log_client_spec.rb +5 -5
- data/spec/in_elb_access_log_config_spec.rb +5 -5
- data/spec/spec_helper.rb +20 -2
- metadata +21 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6cf91d3c27190b1dc3433a92e5710e803616256
|
4
|
+
data.tar.gz: 60e98a16ff1535f1a3bf57807255aa8403eaac01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e1945d726b97db0f0ad9b7038b98958bac3196ec51d77dbf72e04afaf078064c68a7dcb1132df0709f9d1921bc00d7d1e6360a2fad93f6446d4043f903ffa2c
|
7
|
+
data.tar.gz: '0495808a43015a235ba716d5bd43a36f40111014f25bfa4960da80dfd7cb3da7e1174ee0c67e5d6f6b678a900d76cd5f5ec6325604321acdc90727db3bcf39ec'
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Appraisals
ADDED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency 'fluentd'
|
21
|
+
spec.add_dependency 'fluentd'
|
22
22
|
spec.add_dependency 'aws-sdk-s3', '~> 1.8'
|
23
23
|
spec.add_dependency 'addressable'
|
24
24
|
spec.add_dependency 'multiple_files_gzip_reader'
|
@@ -29,4 +29,5 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency 'test-unit', '>= 3.1.0'
|
30
30
|
spec.add_development_dependency 'rspec-match_table', '>= 0.1.1'
|
31
31
|
spec.add_development_dependency 'coveralls'
|
32
|
+
spec.add_development_dependency 'appraisal', '>= 2.2'
|
32
33
|
end
|
@@ -9,7 +9,7 @@ require 'multiple_files_gzip_reader'
|
|
9
9
|
require 'fluent/input'
|
10
10
|
require 'fluent_plugin_elb_access_log/version'
|
11
11
|
|
12
|
-
class
|
12
|
+
class FluentPluginElbAccessLogInput < Fluent::Input
|
13
13
|
Fluent::Plugin.register_input('elb_access_log', self)
|
14
14
|
|
15
15
|
USER_AGENT_SUFFIX = "fluent-plugin-elb-access-log/#{FluentPluginElbAccessLog::VERSION}"
|
@@ -473,4 +473,4 @@ class Fluent::Plugin::ElbAccessLogInput < Fluent::Input
|
|
473
473
|
@log.error_backtrace(e.backtrace)
|
474
474
|
end
|
475
475
|
end # TimerWatcher
|
476
|
-
end #
|
476
|
+
end # FluentPluginElbAccessLogInput
|
@@ -1,4 +1,4 @@
|
|
1
|
-
describe
|
1
|
+
describe FluentPluginElbAccessLogInput do
|
2
2
|
let(:account_id) { '123456789012' }
|
3
3
|
let(:s3_bucket) { 'my-bucket' }
|
4
4
|
let(:region) { 'us-west-1' }
|
@@ -31,8 +31,8 @@ describe Fluent::Plugin::ElbAccessLogInput do
|
|
31
31
|
before do
|
32
32
|
Timecop.freeze(today)
|
33
33
|
allow(Aws::S3::Client).to receive(:new) { client }
|
34
|
-
allow_any_instance_of(
|
35
|
-
allow_any_instance_of(
|
34
|
+
allow_any_instance_of(FluentPluginElbAccessLogInput).to receive(:load_history) { [] }
|
35
|
+
allow_any_instance_of(FluentPluginElbAccessLogInput).to receive(:parse_tsfile) { nil }
|
36
36
|
allow(FileUtils).to receive(:touch)
|
37
37
|
expect(driver.instance.log).to_not receive(:error)
|
38
38
|
end
|
@@ -41,7 +41,7 @@ describe Fluent::Plugin::ElbAccessLogInput do
|
|
41
41
|
Timecop.return
|
42
42
|
end
|
43
43
|
|
44
|
-
subject {
|
44
|
+
subject { driver_events }
|
45
45
|
|
46
46
|
context 'when access log does not exist' do
|
47
47
|
before do
|
@@ -1,4 +1,4 @@
|
|
1
|
-
describe
|
1
|
+
describe FluentPluginElbAccessLogInput do
|
2
2
|
let(:account_id) { '123456789012' }
|
3
3
|
let(:s3_bucket) { 'my-bucket' }
|
4
4
|
let(:region) { 'us-west-1' }
|
@@ -30,8 +30,8 @@ describe Fluent::Plugin::ElbAccessLogInput do
|
|
30
30
|
before do
|
31
31
|
Timecop.freeze(today)
|
32
32
|
allow(Aws::S3::Client).to receive(:new) { client }
|
33
|
-
allow_any_instance_of(
|
34
|
-
allow_any_instance_of(
|
33
|
+
allow_any_instance_of(FluentPluginElbAccessLogInput).to receive(:load_history) { [] }
|
34
|
+
allow_any_instance_of(FluentPluginElbAccessLogInput).to receive(:parse_tsfile) { nil }
|
35
35
|
allow(FileUtils).to receive(:touch)
|
36
36
|
expect(driver.instance.log).to_not receive(:error)
|
37
37
|
end
|
@@ -40,7 +40,7 @@ describe Fluent::Plugin::ElbAccessLogInput do
|
|
40
40
|
Timecop.return
|
41
41
|
end
|
42
42
|
|
43
|
-
subject {
|
43
|
+
subject { driver_events }
|
44
44
|
|
45
45
|
context 'when access log does not exist' do
|
46
46
|
before do
|
@@ -1,4 +1,4 @@
|
|
1
|
-
describe '
|
1
|
+
describe 'FluentPluginElbAccessLogInput#client' do
|
2
2
|
let(:account_id) { '123456789012' }
|
3
3
|
let(:s3_bucket) { 'my-bucket' }
|
4
4
|
let(:region) { 'us-west-1' }
|
@@ -28,8 +28,8 @@ describe 'Fluent::Plugin::ElbAccessLogInput#client' do
|
|
28
28
|
|
29
29
|
before do
|
30
30
|
Timecop.freeze(today)
|
31
|
-
allow_any_instance_of(
|
32
|
-
allow_any_instance_of(
|
31
|
+
allow_any_instance_of(FluentPluginElbAccessLogInput).to receive(:load_history) { [] }
|
32
|
+
allow_any_instance_of(FluentPluginElbAccessLogInput).to receive(:parse_tsfile) { nil }
|
33
33
|
expect(client).to receive(:list_objects).with(bucket: s3_bucket, prefix: yesterday_prefix) { [] }
|
34
34
|
expect(client).to receive(:list_objects).with(bucket: s3_bucket, prefix: today_prefix) { [] }
|
35
35
|
expect(client).to receive(:list_objects).with(bucket: s3_bucket, prefix: tomorrow_prefix) { [] }
|
@@ -48,7 +48,7 @@ describe 'Fluent::Plugin::ElbAccessLogInput#client' do
|
|
48
48
|
specify do
|
49
49
|
expect(Aws::S3::Client).to receive(:new).with(
|
50
50
|
region: region,
|
51
|
-
user_agent_suffix:
|
51
|
+
user_agent_suffix: FluentPluginElbAccessLogInput::USER_AGENT_SUFFIX,
|
52
52
|
).and_return(client)
|
53
53
|
|
54
54
|
driver_run(driver)
|
@@ -73,7 +73,7 @@ describe 'Fluent::Plugin::ElbAccessLogInput#client' do
|
|
73
73
|
specify do
|
74
74
|
expect(Aws::S3::Client).to receive(:new).with(
|
75
75
|
region: region,
|
76
|
-
user_agent_suffix:
|
76
|
+
user_agent_suffix: FluentPluginElbAccessLogInput::USER_AGENT_SUFFIX,
|
77
77
|
access_key_id: aws_key_id,
|
78
78
|
secret_access_key: aws_sec_key,
|
79
79
|
).and_return(client)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
describe '
|
1
|
+
describe 'FluentPluginElbAccessLogInput#configure' do
|
2
2
|
let(:account_id) { '123456789012' }
|
3
3
|
let(:s3_bucket) { 'my-bucket' }
|
4
4
|
let(:region) { 'us-west-1' }
|
@@ -11,8 +11,8 @@ describe 'Fluent::Plugin::ElbAccessLogInput#configure' do
|
|
11
11
|
Timecop.freeze(today)
|
12
12
|
allow(FileUtils).to receive(:touch)
|
13
13
|
allow(File).to receive(:read) { nil }
|
14
|
-
allow_any_instance_of(
|
15
|
-
allow_any_instance_of(
|
14
|
+
allow_any_instance_of(FluentPluginElbAccessLogInput).to receive(:load_history) { [] }
|
15
|
+
allow_any_instance_of(FluentPluginElbAccessLogInput).to receive(:parse_tsfile) { nil }
|
16
16
|
end
|
17
17
|
|
18
18
|
context 'when default' do
|
@@ -157,7 +157,7 @@ describe 'Fluent::Plugin::ElbAccessLogInput#configure' do
|
|
157
157
|
end
|
158
158
|
|
159
159
|
before do
|
160
|
-
allow_any_instance_of(
|
160
|
+
allow_any_instance_of(FluentPluginElbAccessLogInput).to receive(:parse_tsfile) { Time.parse(tsfile_datetime) }
|
161
161
|
end
|
162
162
|
|
163
163
|
it do
|
@@ -179,7 +179,7 @@ describe 'Fluent::Plugin::ElbAccessLogInput#configure' do
|
|
179
179
|
end
|
180
180
|
|
181
181
|
before do
|
182
|
-
allow_any_instance_of(
|
182
|
+
allow_any_instance_of(FluentPluginElbAccessLogInput).to receive(:parse_tsfile) { Time.parse(tsfile_datetime) }
|
183
183
|
allow_any_instance_of(Fluent::Test::TestLogger).to receive(:warn).with("start_datetime(#{start_datetime}) is set. but tsfile datetime(#{tsfile_datetime}) is used")
|
184
184
|
end
|
185
185
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
require 'coveralls'
|
2
2
|
Coveralls.wear!
|
3
3
|
|
4
|
+
require 'fluent/version'
|
4
5
|
require 'fluent/test'
|
5
|
-
|
6
|
+
|
7
|
+
if Gem::Version.new(Fluent::VERSION) >= Gem::Version.new('0.14')
|
8
|
+
require 'fluent/test/driver/input'
|
9
|
+
end
|
10
|
+
|
6
11
|
require 'fluent/plugin/in_elb_access_log'
|
7
12
|
|
8
13
|
require 'aws-sdk-s3'
|
@@ -40,7 +45,11 @@ region #{region}
|
|
40
45
|
#{additional_options}
|
41
46
|
EOS
|
42
47
|
|
43
|
-
|
48
|
+
if Gem::Version.new(Fluent::VERSION) >= Gem::Version.new('0.14')
|
49
|
+
Fluent::Test::Driver::Input.new(FluentPluginElbAccessLogInput).configure(fluentd_conf)
|
50
|
+
else
|
51
|
+
Fluent::Test::OutputTestDriver.new(FluentPluginElbAccessLogInput).configure(fluentd_conf)
|
52
|
+
end
|
44
53
|
end
|
45
54
|
|
46
55
|
def driver_run(driver)
|
@@ -51,6 +60,15 @@ def driver_run(driver)
|
|
51
60
|
end
|
52
61
|
end
|
53
62
|
|
63
|
+
|
64
|
+
def driver_events
|
65
|
+
if Gem::Version.new(Fluent::VERSION) >= Gem::Version.new('0.14')
|
66
|
+
driver.events
|
67
|
+
else
|
68
|
+
driver.emits
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
54
72
|
def gzip(str)
|
55
73
|
io = StringIO.new
|
56
74
|
|
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.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: aws-sdk-s3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: appraisal
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '2.2'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '2.2'
|
167
181
|
description: Fluentd input plugin for AWS ELB Access Logs.
|
168
182
|
email:
|
169
183
|
- sugawara@cookpad.com
|
@@ -176,11 +190,14 @@ files:
|
|
176
190
|
- ".rspec"
|
177
191
|
- ".simplecov"
|
178
192
|
- ".travis.yml"
|
193
|
+
- Appraisals
|
179
194
|
- Gemfile
|
180
195
|
- LICENSE.txt
|
181
196
|
- README.md
|
182
197
|
- Rakefile
|
183
198
|
- fluent-plugin-elb-access-log.gemspec
|
199
|
+
- gemfiles/fluentd_0.12.gemfile
|
200
|
+
- gemfiles/fluentd_0.14.gemfile
|
184
201
|
- lib/fluent/plugin/in_elb_access_log.rb
|
185
202
|
- lib/fluent_plugin_elb_access_log/version.rb
|
186
203
|
- spec/in_elb_access_log_alb_spec.rb
|