README.rdoc in fluent-plugin-sns-2.0.2 vs README.rdoc in fluent-plugin-sns-2.1.0
- old
+ new
@@ -19,14 +19,14 @@
# following attibutes are required
sns_topic_name {sns_topic_name}
- # following attibutes are required if you don't use IAM Role
+ # following attibutes are required if you don't use IAM Role and you don't set environment variables
- aws_key_id {your_aws_key_id}
- aws_sec_key {your_aws_secret_key}
+ aws_key_id {your_aws_key_id} # Default: ENV['AWS_ACCESS_KEY_ID']
+ aws_sec_key {your_aws_secret_key} # Default: ENV['AWS_SECRET_ACCESS_KEY']
# following attibutes are optional
sns_endpoint {endpointURL}
@@ -37,25 +37,47 @@
# US-West (Oregon) : sns.us-west-2.amazonaws.com
# US-West (N.California) : sns.us-west-1.amazonaws.com
# EU-West (Ireland) : sns.eu-west-1.amazonaws.com
# South America (São Paulo) : sns.sa-east-1.amazonaws.com
+ sns_subject_template {template_erb_file_path}
sns_subject_key {sns_subject_key}
sns_subject {sns_subject} #constant subject
+ sns_body_template {sns_body_template}
+ sns_body_key {sns_body_key}
+
proxy http(s)://{url}:{port}
</match>
-== TODO
-=== More configuration
-- E-Mail formatter
-- buffer-output
+== Example
-== Test
-- Other Notification Protcol (HTTP/HTTPS,SQS,SMS)
+=== fluentd.conf
-== Tool
+ <match sns.**>
+
+ type sns
+
+ sns_topic_name example
+
+ sns_endpoint sns.ap-northeast-1.amazonaws.com
+
+ sns_subject_key from
+ sns_body_template /path/to/template/body_template.erb
+
+ </match>
+
+=== template
+
+/path/to/template/body_template.erb
+ hello <%= record['to'] %>!
+
+=== sample input
+
+ $ echo '{"from":'Alice',"to":"Bob" }' | fluent-cat sns.example
+
+Then, the message is published. (subject -> 'Alice', body -> 'hello Bob!')
== Copyright
Copyright:: Copyright (c) 2011- Yuri Odagiri
License:: Apache License, Version 2.0