fluent-plugin-sns 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/fluent/plugin/out_sns.rb +21 -14
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -5,40 +5,40 @@ module Fluent
|
|
5
5
|
class SNSOutput < Output
|
6
6
|
|
7
7
|
Fluent::Plugin.register_output('sns', self)
|
8
|
-
|
8
|
+
|
9
9
|
include SetTagKeyMixin
|
10
10
|
config_set_default :include_tag_key, false
|
11
|
-
|
11
|
+
|
12
12
|
include SetTimeKeyMixin
|
13
13
|
config_set_default :include_time_key, true
|
14
14
|
|
15
15
|
config_param :aws_key_id, :string
|
16
16
|
config_param :aws_sec_key, :string
|
17
|
-
|
17
|
+
|
18
18
|
config_param :sns_topic_name, :string
|
19
19
|
config_param :sns_subject_key, :string, :default => nil
|
20
20
|
config_param :sns_subject, :string, :default => nil
|
21
21
|
config_param :sns_endpoint, :string, :default => 'sns.ap-northeast-1.amazonaws.com'
|
22
|
-
|
22
|
+
|
23
23
|
def configure(conf)
|
24
24
|
super
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
def start
|
28
28
|
super
|
29
29
|
AWS.config(
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
:access_key_id => @aws_key_id,
|
31
|
+
:secret_access_key => @aws_sec_key,
|
32
|
+
:sns_endpoint => @sns_endpoint )
|
33
|
+
|
34
34
|
@sns = AWS::SNS.new
|
35
|
-
@topic =
|
35
|
+
@topic = get_topic
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
def shutdown
|
39
39
|
super
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
def emit(tag, es, chain)
|
43
43
|
chain.next
|
44
44
|
es.each {|time,record|
|
@@ -47,6 +47,13 @@ module Fluent
|
|
47
47
|
@topic.publish(record.to_json, :subject => subject )
|
48
48
|
}
|
49
49
|
end
|
50
|
-
|
50
|
+
|
51
|
+
def get_topic()
|
52
|
+
@sns.topics.each do |topic|
|
53
|
+
if @sns_topic_name = topic.name
|
54
|
+
return topic
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
51
58
|
end
|
52
|
-
end
|
59
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-sns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-02-02 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fluentd
|
16
|
-
requirement: &
|
16
|
+
requirement: &70176482177660 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 0.10.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70176482177660
|
25
25
|
description:
|
26
26
|
email: ixixizko@gmail.com
|
27
27
|
executables: []
|