GithubHelp home page GithubHelp logo

fatum / fluent-plugin-dynamodb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gonsuke/fluent-plugin-dynamodb

0.0 2.0 0.0 123 KB

Amazon DynamoDB output plugin for Fluent event collector

Ruby 100.00%

fluent-plugin-dynamodb's Introduction

Amazon DynamoDB output plugin for Fluentd event collector

##Installation

$ fluent-gem install fluent-plugin-dynamodb

##Configuration

###DynamoDB

First of all, you need to create a table in DynamoDB. It's easy to create via Management Console.

Specify table name, hash attribute name and throughput as you like. fluent-plugin-dynamodb will load your table schema and write event-stream out to your table.

Fluentd

<match dynamodb.**>
  type dynamodb
  aws_key_id AWS_ACCESS_KEY
  aws_sec_key AWS_SECRET_ACCESS_KEY
  proxy_uri http://user:[email protected]:3128/
  dynamo_db_endpoint dynamodb.ap-northeast-1.amazonaws.com
  dynamo_db_table access_log
</match>
  • aws_key_id (optional) - AWS access key id. This parameter is required when your agent is not running on EC2 instance with an IAM Instance Profile.
  • aws_sec_key (optional) - AWS secret key. This parameter is required when your agent is not running on EC2 instance with an IAM Instance Profile.
  • proxy_uri (optional) - your proxy url.
  • dynamo_db_endpoint (required) - end point of dynamodb. see Regions and Endpoints
  • dynamo_db_table (required) - table name of dynamodb.

##TIPS

###retrieving data

fluent-plugin-dynamo will add time attribute and any other attributes of record automatically. For example if you read apache's access log via fluentd, structure of the table will have been like this.

id (Hash Key) time host path method referer code agent size
"a937f980-b304-11e1-bc96-c82a14fffef2" "2012-06-10T05:26:46Z" "192.168.0.3" "/index.html" "GET" "-" "200" "Mozilla/5.0" "4286"
"a87fc51e-b308-11e1-ba0f-5855caf50759" "2012-06-10T05:28:23Z" "192.168.0.4" "/sample.html" "GET" "-" "200" "Mozilla/5.0" "8933"

Item can be retrieved by the key, but fluent-plugin-dynamo uses UUID as a primary key. There is no simple way to retrieve logs you want. By the way, you can write scan-filter with AWS SDK like this, but Hive on EMR is the best practice I think.

###multiprocessing

If you need high throughput and if you have much provisioned throughput and abudant buffer, you can setup multiprocessing. fluent-plugin-dynamo inherits DetachMultiProcessMixin, so you can launch 6 processes as follows.

<match dynamodb.**>
  type dynamodb
  aws_key_id AWS_ACCESS_KEY
  aws_sec_key AWS_SECRET_ACCESS_KEY
  proxy_uri http://user:[email protected]:3128/
  detach_process 6
  dynamo_db_endpoint dynamodb.ap-northeast-1.amazonaws.com
  dynamo_db_table access_log
</match>

###multi-region redundancy

As you know fluentd has copy output plugin. So you can easily setup multi-region redundancy as follows.

<match dynamo.**>
  type copy
  <store>
    type dynamodb
    aws_key_id AWS_ACCESS_KEY
    aws_sec_key AWS_SECRET_ACCESS_KEY
    dynamo_db_table test
    dynamo_db_endpoint dynamodb.ap-northeast-1.amazonaws.com
  </store>
  <store>
    type dynamodb
    aws_key_id AWS_ACCESS_KEY
    aws_sec_key AWS_SECRET_ACCESS_KEY
    dynamo_db_table test
    dynamo_db_endpoint dynamodb.ap-southeast-1.amazonaws.com
  </store>
</match>

##TODO

  • auto-create table
  • tag_mapped

##Copyright

CopyrightCopyright (c) 2012- Takashi Matsuno
LicenseApache License, Version 2.0

fluent-plugin-dynamodb's People

Contributors

dekked avatar eipipuz avatar fatum avatar frsyuki avatar gonsuke avatar kiyoto avatar

Watchers

 avatar  avatar

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.