Class: Fluent::SNSOutput
- Inherits:
-
Output
- Object
- Output
- Fluent::SNSOutput
- Includes:
- SetTagKeyMixin, SetTimeKeyMixin
- Defined in:
- lib/fluent/plugin/out_sns.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
- #emit(tag, es, chain) ⇒ Object
- #get_topic ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
Instance Method Details
#configure(conf) ⇒ Object
24 25 26 |
# File 'lib/fluent/plugin/out_sns.rb', line 24 def configure(conf) super end |
#emit(tag, es, chain) ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/fluent/plugin/out_sns.rb', line 47 def emit(tag, es, chain) chain.next es.each {|time,record| record["time"] = Time.at(time).localtime subject = record[@sns_subject_key] || @sns_subject || 'Fluent-Notification' @topic.publish(record.to_json, :subject => subject ) } end |
#get_topic ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/fluent/plugin/out_sns.rb', line 56 def get_topic() @sns.topics.each do |topic| if @sns_topic_name == topic.name return topic end end end |
#shutdown ⇒ Object
43 44 45 |
# File 'lib/fluent/plugin/out_sns.rb', line 43 def shutdown super end |
#start ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fluent/plugin/out_sns.rb', line 28 def start super = {} [:sns_endpoint] = @sns_endpoint [:proxy_uri] = @proxy if @aws_key_id && @aws_sec_key [:access_key_id] = @aws_key_id [:secret_access_key] = @aws_sec_key end AWS.config() @sns = AWS::SNS.new @topic = get_topic end |