Giter Club home page Giter Club logo

logstash-output-amazon_es's Introduction

Logstash Plugin

This is a plugin for Logstash.

License

This library is licensed under Apache License 2.0.

Compatibility

The following table shows the versions of logstash and logstash-output-amazon_es Plugin was built with.

logstash-output-amazon_es Logstash
6.0.0 <6.0.0
6.4.0 >6.0.0

Configuration for Amazon Elasticsearch Output Plugin

To run the Logstash Output Amazon Elasticsearch plugin, simply add a configuration following the below documentation.

An example configuration:

output {
    amazon_es {
        hosts => ["foo.us-east-1.es.amazonaws.com"]
        region => "us-east-1"
        # aws_access_key_id and aws_secret_access_key are optional if instance profile is configured
        aws_access_key_id => 'ACCESS_KEY'
        aws_secret_access_key => 'SECRET_KEY'
        index => "production-logs-%{+YYYY.MM.dd}"
    }
}

Required Parameters

  • hosts (array of string) - the Amazon Elasticsearch Service domain endpoint (e.g. ["foo.us-east-1.es.amazonaws.com"])
  • region (string, :default => "us-east-1") - region where the domain is located

Optional Parameters

  • Credential parameters:

    • aws_access_key_id, :validate => :string - optional AWS access key

    • aws_secret_access_key, :validate => :string - optional AWS secret key

      The credential resolution logic can be described as follows:

      • User passed aws_access_key_id and aws_secret_access_key in amazon_es configuration
      • Environment variables - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY (RECOMMENDED since they are recognized by all the AWS SDKs and CLI except for .NET), or AWS_ACCESS_KEY and AWS_SECRET_KEY (only recognized by Java SDK)
      • Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
      • Instance profile credentials delivered through the Amazon EC2 metadata service
  • template (path) - You can set the path to your own template here, if you so desire. If not set, the included template will be used.

  • template_name (string, default => "logstash") - defines how the template is named inside Elasticsearch

  • port (string, default 443) - Amazon Elasticsearch Service listens on port 443 for HTTPS (default) and port 80 for HTTP. Tweak this value for a custom proxy.

  • protocol (string, default https) - The protocol used to connect to the Amazon Elasticsearch Service

Developing

1. Plugin Development and Testing

Code

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

  2. Create a new plugin or clone and existing from the GitHub logstash-plugins organization. Example plugins exist.

  3. Install dependencies:

    bundle install

Test

  1. Update your dependencies:

    bundle install
  2. Run unit tests:

    bundle exec rspec

2. Running your unpublished plugin in Logstash

2.1 Run in a local Logstash clone

  1. Edit Logstash Gemfile and add the local plugin path, for example:

    gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
  2. Install the plugin:

    # Logstash 2.3 and higher
    bin/logstash-plugin install --no-verify
    
    # Prior to Logstash 2.3
    bin/plugin install --no-verify
  3. 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 re-run Logstash.

2.2 Run in an installed Logstash

Before build your Gemfile, please make sure use JRuby. Here is how you can know your local Ruby version:

rvm list

Please make sure you current using JRuby. Here is how you can change to JRuby

rvm jruby

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. You can also build the gem and install it using:

  1. Build your plugin gem:

    gem build logstash-filter-awesome.gemspec
  2. Install the plugin from the Logstash home:

    # Logstash 2.3 and higher
    bin/logstash-plugin install --no-verify
    
    # Prior to Logstash 2.3
    bin/plugin install --no-verify
  3. Start Logstash and test the plugin.

Old version support

If you want to use old version of logstash-output-amazon_es, you can install with this:

bin/logstash-plugin install logstash-output-amazon_es -v 2.0.0

Contributing

All contributions are welcome: ideas, patches, documentation, bug reports, and complaints.

logstash-output-amazon_es's People

Contributors

malpani avatar msfroh avatar xyq164202 avatar aetter avatar adamgoucher avatar wanix avatar cgansen avatar hyandell avatar jpeddicord avatar alongmuaz avatar tbenade avatar tobiasbayer avatar zhaojunz avatar asemt avatar

Watchers

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