fluent-plugin-elb-log 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -2
- data/fluent-plugin-elb-log.gemspec +1 -1
- data/lib/fluent/plugin/in_elb_log.rb +15 -7
- metadata +26 -16
- checksums.yaml +0 -7
data/README.md
CHANGED
@@ -16,13 +16,17 @@
|
|
16
16
|
```config
|
17
17
|
<source>
|
18
18
|
type elb_log
|
19
|
-
|
20
|
-
|
19
|
+
|
20
|
+
# following attibutes are required
|
21
21
|
s3_endpoint <s3_endpoint>
|
22
22
|
s3_bucketname <bucketname>
|
23
23
|
s3_prefix <elb log's prefix>
|
24
24
|
timestamp_file <proc last file timestamp record filename>
|
25
25
|
refresh_interval <interval number by second>
|
26
|
+
|
27
|
+
# following attibutes are required if you don't use IAM Role
|
28
|
+
access_key_id <access_key>
|
29
|
+
secret_access_key <secret_access_key>
|
26
30
|
</source>
|
27
31
|
```
|
28
32
|
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-elb-log"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.4"
|
8
8
|
spec.authors = ["shinsaka"]
|
9
9
|
spec.email = ["shinx1265@gmail.com"]
|
10
10
|
spec.summary = "Amazon ELB log input plugin"
|
@@ -15,8 +15,12 @@ class Fluent::Elb_LogInput < Fluent::Input
|
|
15
15
|
def configure(conf)
|
16
16
|
super
|
17
17
|
require 'aws-sdk'
|
18
|
-
|
19
|
-
|
18
|
+
require 'net/http'
|
19
|
+
iam = Net::HTTP.get_response('169.254.169.254','/latest/meta-data/iam/info')
|
20
|
+
if iam.msg != 'OK'
|
21
|
+
raise Fluent::ConfigError.new("access_key_id is required") unless @access_key_id
|
22
|
+
raise Fluent::ConfigError.new("secret_access_key is required") unless @secret_access_key
|
23
|
+
end
|
20
24
|
raise Fluent::ConfigError.new("s3_bucketname is required") unless @s3_bucketname
|
21
25
|
raise Fluent::ConfigError.new("timestamp_file is required") unless @timestamp_file
|
22
26
|
end
|
@@ -45,10 +49,14 @@ class Fluent::Elb_LogInput < Fluent::Input
|
|
45
49
|
private
|
46
50
|
|
47
51
|
def init_s3bucket
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
+
options = {}
|
53
|
+
if @access_key_id && @secret_access_key
|
54
|
+
options[:access_key_id] = @access_key_id
|
55
|
+
options[:secret_access_key] = @secret_access_key
|
56
|
+
end
|
57
|
+
options[:s3_endpoint] = @s3_endpoint if @s3_endpoint
|
58
|
+
|
59
|
+
@bucket = AWS::S3.new(options).buckets[@s3_bucketname]
|
52
60
|
end
|
53
61
|
|
54
62
|
def run
|
@@ -58,7 +66,7 @@ class Fluent::Elb_LogInput < Fluent::Input
|
|
58
66
|
def input
|
59
67
|
$log.info "fluent-plugin-elb-log: input start"
|
60
68
|
|
61
|
-
#get timestamp last proc
|
69
|
+
# get timestamp last proc
|
62
70
|
@timestamp_file.rewind
|
63
71
|
timestamp = @timestamp_file.read.to_i
|
64
72
|
timestamp = 0 unless timestamp
|
metadata
CHANGED
@@ -1,69 +1,78 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-elb-log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- shinsaka
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: fluentd
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '0'
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0'
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: aws-sdk
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- -
|
35
|
+
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: '0'
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- -
|
43
|
+
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '0'
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: bundler
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
|
-
- -
|
51
|
+
- - ~>
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '1.5'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - ~>
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '1.5'
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: rake
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
|
-
- -
|
67
|
+
- - ! '>='
|
60
68
|
- !ruby/object:Gem::Version
|
61
69
|
version: '0'
|
62
70
|
type: :development
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
|
-
- -
|
75
|
+
- - ! '>='
|
67
76
|
- !ruby/object:Gem::Version
|
68
77
|
version: '0'
|
69
78
|
description: Amazon ELB log input plugin for fluentd
|
@@ -73,7 +82,7 @@ executables: []
|
|
73
82
|
extensions: []
|
74
83
|
extra_rdoc_files: []
|
75
84
|
files:
|
76
|
-
-
|
85
|
+
- .gitignore
|
77
86
|
- Gemfile
|
78
87
|
- LICENSE.txt
|
79
88
|
- README.md
|
@@ -84,25 +93,26 @@ files:
|
|
84
93
|
homepage: https://github.com/shinsaka/fluent-plugin-elb-log
|
85
94
|
licenses:
|
86
95
|
- MIT
|
87
|
-
metadata: {}
|
88
96
|
post_install_message:
|
89
97
|
rdoc_options: []
|
90
98
|
require_paths:
|
91
99
|
- lib
|
92
100
|
required_ruby_version: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
93
102
|
requirements:
|
94
|
-
- -
|
103
|
+
- - ! '>='
|
95
104
|
- !ruby/object:Gem::Version
|
96
105
|
version: '0'
|
97
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
98
108
|
requirements:
|
99
|
-
- -
|
109
|
+
- - ! '>='
|
100
110
|
- !ruby/object:Gem::Version
|
101
111
|
version: '0'
|
102
112
|
requirements: []
|
103
113
|
rubyforge_project:
|
104
|
-
rubygems_version:
|
114
|
+
rubygems_version: 1.8.25
|
105
115
|
signing_key:
|
106
|
-
specification_version:
|
116
|
+
specification_version: 3
|
107
117
|
summary: Amazon ELB log input plugin
|
108
118
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 2c57710335426fbb004c05954b0c73755fa1ffd1
|
4
|
-
data.tar.gz: b460acfce0169519014318ace7636cb5317fe94d
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 05be1055e6dc9f557a756c2e92f8d766c759824508592bf4d81caaca08dd1b6584396e688e5ee59fe7bbb17730c145152869fc34d834d6c16340ab313b336bb2
|
7
|
-
data.tar.gz: ef8d05ac805376004bac91ae0a4d457545b8ee26a8c55501438024ba2e8e6e3c0b1f9094dfbb4d677cc6f1c2abc4f065971e864adc0ebfd6b1edc8c3f1e51a1a
|