Giter Site home page Giter Site logo

fluent-plugin-sns's Introduction

Amazon SNS output plugin for Fluent

Install

$ gem install fluent-plugin-sns

Component

SNSOutput

Send fluent-event as message to amazon SNS.

Configuratin

SNSOutput

<match sns.**>

  type sns

  # following attibutes are required

  sns_topic_name {sns_topic_name}

  # following attibutes are required if you don't use IAM Role nor export credentials to ENV

  aws_key_id {your_aws_key_id}
  aws_sec_key {your_aws_secret_key}

  # following attibutes are optional

  # AWS region (defaults to 'ap-northeast-1'), for a list of all available
  # regions see: http://docs.aws.amazon.com/general/latest/gr/rande.html#sns_region
  sns_region {region}

  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}

  # SNS Message attributes:
  # http://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html
  # Note that currently only string values are supported.
  sns_message_attributes {attribute: string_value}
  sns_message_attributes_keys {attribute: key_in_record_with_string_value}

  proxy http(s)://{url}:{port}

</match>

Example

fluentd.conf

<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 © 2011- Yuri Odagiri

License

Apache License, Version 2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.