fluent-plugin-elb-access-log 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -1
- data/lib/fluent/plugin/in_elb_access_log.rb +2 -0
- data/lib/fluent_plugin_elb_access_log/version.rb +1 -1
- data/spec/in_elb_access_log_config_spec.rb +88 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 708a7b3cc210ec51adf16b678c510529335d9659
|
4
|
+
data.tar.gz: 81a788c178174442d67752d883c03afbf6c44605
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b39bfbb3267a1472decb677a86e230b03376df6aacc4a6b91ab491f2ebbb13849a9da5e5e8e547ddf62a235a42846461abdf583692dd415469b843c697073eb8
|
7
|
+
data.tar.gz: f317d442e2ca203561f5cb0037eef80b50e18d2945d68a3d7e9b234eec57c738753d363fb3038664d5769cd9cf5a12e1aee13c236b47106c2c6bef108591738d
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Fluentd input plugin for [AWS ELB Access Logs](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/access-log-collection.html).
|
4
4
|
|
5
|
-
[![Gem Version](https://badge.fury.io/rb/fluent-plugin-elb-access-log.
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/fluent-plugin-elb-access-log.svg)](http://badge.fury.io/rb/fluent-plugin-elb-access-log)
|
6
6
|
[![Build Status](https://travis-ci.org/winebarrel/fluent-plugin-elb-access-log.svg?branch=master)](https://travis-ci.org/winebarrel/fluent-plugin-elb-access-log)
|
7
7
|
|
8
8
|
## Installation
|
@@ -30,6 +30,7 @@ Or install it yourself as:
|
|
30
30
|
#aws_sec_key YOUR_SECRET_ACCESS_KEY
|
31
31
|
#profile PROFILE_NAME
|
32
32
|
#credentials_path path/to/credentials_file
|
33
|
+
#http_proxy http://...
|
33
34
|
|
34
35
|
account_id 123456789012 # required
|
35
36
|
s3_bucket BUCKET_NAME # required
|
@@ -73,3 +74,11 @@ Or install it yourself as:
|
|
73
74
|
"request.uri.fragment":null
|
74
75
|
}
|
75
76
|
```
|
77
|
+
|
78
|
+
# Difference with [fluent-plugin-elb-log](https://github.com/shinsaka/fluent-plugin-elb-log)
|
79
|
+
|
80
|
+
* Use AWS SDK for Ruby V2.
|
81
|
+
* It is possible to change the record tag.
|
82
|
+
* List objects with prefix.
|
83
|
+
* Perse request line URI.
|
84
|
+
* It has tests other than the configuration file.
|
@@ -33,6 +33,7 @@ class Fluent::ElbAccessLogInput < Fluent::Input
|
|
33
33
|
config_param :aws_sec_key, :string, :default => nil
|
34
34
|
config_param :profile, :string, :default => nil
|
35
35
|
config_param :credentials_path, :string, :default => nil
|
36
|
+
config_param :http_proxy, :string, :default => nil
|
36
37
|
config_param :account_id, :string
|
37
38
|
config_param :s3_bucket, :string
|
38
39
|
config_param :s3_region, :string
|
@@ -176,6 +177,7 @@ class Fluent::ElbAccessLogInput < Fluent::Input
|
|
176
177
|
|
177
178
|
options = {:user_agent_suffix => USER_AGENT_SUFFIX}
|
178
179
|
options[:region] = @region if @region
|
180
|
+
options[:http_proxy] = @http_proxy if @http_proxy
|
179
181
|
|
180
182
|
if @aws_key_id and @aws_sec_key
|
181
183
|
options[:access_key_id] = @aws_key_id
|
@@ -0,0 +1,88 @@
|
|
1
|
+
describe 'Fluent::ElbAccessLogInput#configure' do
|
2
|
+
let(:account_id) { '123456789012' }
|
3
|
+
let(:s3_bucket) { 'my-bucket' }
|
4
|
+
let(:s3_region) { 'us-west-1' }
|
5
|
+
let(:driver) { create_driver(fluentd_conf) }
|
6
|
+
let(:today) { Time.parse('2015/05/24 18:30 UTC') }
|
7
|
+
|
8
|
+
subject { create_driver(fluentd_conf).instance }
|
9
|
+
|
10
|
+
before do
|
11
|
+
Timecop.freeze(today)
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'when default' do
|
15
|
+
let(:fluentd_conf) do
|
16
|
+
{
|
17
|
+
account_id: account_id,
|
18
|
+
s3_bucket: s3_bucket,
|
19
|
+
s3_region: s3_region,
|
20
|
+
interval: nil,
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
it do
|
25
|
+
expect(driver.instance.aws_key_id).to be_nil
|
26
|
+
expect(driver.instance.aws_sec_key).to be_nil
|
27
|
+
expect(driver.instance.profile).to be_nil
|
28
|
+
expect(driver.instance.credentials_path).to be_nil
|
29
|
+
expect(driver.instance.http_proxy).to be_nil
|
30
|
+
expect(driver.instance.s3_bucket).to eq s3_bucket
|
31
|
+
expect(driver.instance.s3_region).to eq s3_region
|
32
|
+
expect(driver.instance.s3_prefix).to be_nil
|
33
|
+
expect(driver.instance.tag).to eq 'elb.access_log'
|
34
|
+
expect(driver.instance.tsfile_path).to eq '/var/tmp/fluent-plugin-elb-access-log.ts'
|
35
|
+
expect(driver.instance.interval).to eq 300
|
36
|
+
expect(driver.instance.start_datetime).to eq today
|
37
|
+
expect(driver.instance.debug).to be_falsey
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'when pass params' do
|
42
|
+
let(:aws_key_id) { 'YOUR_ACCESS_KEY_ID' }
|
43
|
+
let(:aws_sec_key) { 'YOUR_SECRET_ACCESS_KEY' }
|
44
|
+
let(:profile) { 'PROFILE_NAME' }
|
45
|
+
let(:credentials_path) { 'path/to/credentials_file' }
|
46
|
+
let(:http_proxy) { 'http://example.net' }
|
47
|
+
let(:s3_prefix) { 's3-prefix' }
|
48
|
+
let(:tag) { 'any.tag' }
|
49
|
+
let(:tsfile_path) { '/tmp/foo' }
|
50
|
+
let(:interval) { 500 }
|
51
|
+
let(:start_datetime) { today - 3600 }
|
52
|
+
|
53
|
+
let(:fluentd_conf) do
|
54
|
+
{
|
55
|
+
aws_key_id: aws_key_id,
|
56
|
+
aws_sec_key: aws_sec_key,
|
57
|
+
profile: profile,
|
58
|
+
credentials_path: credentials_path,
|
59
|
+
http_proxy: http_proxy,
|
60
|
+
account_id: account_id,
|
61
|
+
s3_bucket: s3_bucket,
|
62
|
+
s3_region: s3_region,
|
63
|
+
s3_prefix: s3_prefix,
|
64
|
+
tag: tag,
|
65
|
+
tsfile_path: tsfile_path,
|
66
|
+
interval: interval,
|
67
|
+
start_datetime: start_datetime,
|
68
|
+
debug: true,
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
it do
|
73
|
+
expect(driver.instance.aws_key_id).to eq aws_key_id
|
74
|
+
expect(driver.instance.aws_sec_key).to eq aws_sec_key
|
75
|
+
expect(driver.instance.profile).to eq profile
|
76
|
+
expect(driver.instance.credentials_path).to eq credentials_path
|
77
|
+
expect(driver.instance.http_proxy).to eq http_proxy
|
78
|
+
expect(driver.instance.s3_bucket).to eq s3_bucket
|
79
|
+
expect(driver.instance.s3_region).to eq s3_region
|
80
|
+
expect(driver.instance.s3_prefix).to eq s3_prefix
|
81
|
+
expect(driver.instance.tag).to eq tag
|
82
|
+
expect(driver.instance.tsfile_path).to eq tsfile_path
|
83
|
+
expect(driver.instance.interval).to eq interval
|
84
|
+
expect(driver.instance.start_datetime).to eq start_datetime
|
85
|
+
expect(driver.instance.debug).to be_truthy
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Sugawara
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- fluent-plugin-elb-access-log.gemspec
|
112
112
|
- lib/fluent/plugin/in_elb_access_log.rb
|
113
113
|
- lib/fluent_plugin_elb_access_log/version.rb
|
114
|
+
- spec/in_elb_access_log_config_spec.rb
|
114
115
|
- spec/in_elb_access_log_spec.rb
|
115
116
|
- spec/spec_helper.rb
|
116
117
|
homepage: https://github.com/winebarrel/fluent-plugin-elb-access-log
|
@@ -138,5 +139,6 @@ signing_key:
|
|
138
139
|
specification_version: 4
|
139
140
|
summary: Fluentd input plugin for AWS ELB Access Logs.
|
140
141
|
test_files:
|
142
|
+
- spec/in_elb_access_log_config_spec.rb
|
141
143
|
- spec/in_elb_access_log_spec.rb
|
142
144
|
- spec/spec_helper.rb
|