Giter Site home page Giter Site logo

alphastaxllc / logstash-input-dynamodb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amazon-archives/logstash-input-dynamodb

0.0 3.0 0.0 87 KB

This input plugin for Logstash scans a specified DynamoDB table and then reads changes to a DynamoDB table from the associated DynamoDB Stream.This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline. This gem is not a stand-alone program.

License: Apache License 2.0

Ruby 100.00%

logstash-input-dynamodb's Introduction

Logstash Plugin

NOTE: CONFIGURATION ON RUNNING THE INPUT PLUGIN FOR DYNAMODB LOOK AT THE BOTTOM

This is a plugin for Logstash.

It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.

Documentation

Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one central location.

Need Help?

Need help? Try #logstash on freenode IRC or the [email protected] mailing list.

Developing

1. Plugin Developement and Testing

Code

  • To get started, you'll need JRuby with the Bundler gem installed.

  • Create a new plugin or clone and existing from the GitHub logstash-plugins organization. We also provide example plugins.

  • Install dependencies

bundle install

Test

  • Update your dependencies

#####TODO: NOT DONE YET

bundle install
  • Run tests
bundle exec rspec

2. Running your unpublished Plugin in Logstash

2.1 Run in a local Logstash clone

TODO need to figure out the local plugin path. For now use 'gem build logstash-input-dynamodbstreams.gemspec' and add the absolute path of this the gem created to the Gemfile of the logstash app.
  • Edit Logstash Gemfile and add the local plugin path, for example:
gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
  • Install plugin
bin/plugin install --no-verify
  • Run Logstash with your plugin
bin/logstash -e 'filter {awesome {}}'

At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.

2.2 Run in an installed Logstash

You can use the same 2.1 method to run your plugin in an installed Logstash by editing its Gemfile and pointing the :path to your local plugin development directory or you can build the gem and install it using:

  • Install all dependencies of the gem
bundle install
  • Build your plugin gem
gem build logstash-filter-awesome.gemspec
  • Install the plugin from the Logstash home
bin/plugin install /your/local/plugin/logstash-filter-awesome.gem
  • Start Logstash and proceed to test the plugin

Contributing

All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.

Programming is not a required skill. Whatever you've seen about open source and maintainers or community members saying "send patches or die" - you will not see that here.

It is more important to the community that you are able to contribute.

For more information about contributing, see the CONTRIBUTING file.

#Configuration for DynamoDB Logstash plugin

To run the DynamoDB Logstash plugin simply add a configuration following the below documentation.

An example configuration: input { dynamodb { table_name => "My_DynamoDB_Table" endpoint => "dynamodb.us-west-1.amazonaws.com" streams_endpoint => "streams.dynamodb.us-west-1.amazonaws.com" aws_access_key_id => "my aws access key" aws_secret_access_key => "my aws secret access key" perform_scan => true perform_stream => true read_ops => 100 number_of_write_threads => 8 number_of_scan_threads => 8 log_format => "plain" view_type => "new_and_old_images" } }

#Configuration Parameters

config :, , :required => , :default =>

The name of the table to copy and stream through Logstash

config :table_name, :validate => :string, :required => true

Configuration for what information from the scan and streams to include in the log.

keys_only will return the hash and range keys along with the values for each entry

new_image will return the entire new entry and keys

old_image will return the entire entry before modification and keys (NOTE: Cannot perform scan when using this option)

new_and_old_images will return the old entry before modification along with the new entry and keys

config :view_type, :validate => ["keys_only", "new_image", "old_image", "new_and_old_images"], :required => true

Endpoint from which the table is located. Example: dynamodb.us-east-1.amazonaws.com

config :endpoint, :validate => :string, :required => true

Endpoint from which streams should read. Example: streams.dynamodb.us-east-1.amazonaws.com

config :streams_endpoint, :validate => :string

AWS credentials access key.

config :aws_access_key_id, :validate => :string, :default => ""

AWS credentials secret access key.

config :aws_secret_access_key, :validate => :string, :default => ""

A flag to indicate whether or not the plugin should scan the entire table before streaming new records.

Streams will only push records that are less than 24 hours old, so in order to get the entire table

an initial scan must be done.

config :perform_scan, :validate => :boolean, :default => true

A string that uniquely identifies the KCL checkpointer name and cloudwatch metrics name.

This is used when one worker leaves a shard so that another worker knows where to start again.

config :checkpointer, :validate => :string, :default => "logstash_input_dynamodb_cptr"

Option to publish metrics to Cloudwatch using the checkpointer name.

config :publish_metrics, :validate => :boolean, :default => false

Option to not automatically stream new data into logstash from DynamoDB streams.

config :perform_stream, :validate => :boolean, :default => true

Number of read operations per second to perform when scanning the specified table.

config :read_ops, :validate => :number, :default => 1

Number of threads to use when scanning the specified table

config :number_of_scan_threads, :validate => :number, :default => 1

Number of threads to write to the logstash queue when scanning the table

config :number_of_write_threads, :validate => :number, :default => 1

Configuation for how the logs will be transferred.

plain is simply pass the message along without editing it.

dynamodb will return just the data specified in the view_format in dynamodb format.

# For more information see: docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html

json_drop_binary will return just the data specified in the view_format in JSON while not including any binary values that were present.

json_binary_as_text will return just the data specified in the view_format in JSON while including binary values as base64-encoded text.

config :log_format, :validate => ["plain", "dynamodb", "json_drop_binary", "json_binary_as_text"], :default => "plain"

logstash-input-dynamodb's People

Contributors

suyograo avatar

Watchers

Steven avatar James Cloos avatar Josh Garrett 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.