Code Monkey home page Code Monkey logo

logstash-input-s3file_via_sqs's Introduction

Logstash S3 Via SQS Plugin

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.

Pull S3 file names from SQS, Download the files, parse it with Logstash then delete the local file

How to work with this plugin

Configure event notification on S3 bucket for put operations to send the newly added file to SQS designated queue

Required S3 Permissions

This plugin reads from your S3 bucket, and would require the following permissions applied to the AWS IAM Policy being used:

  • s3:ListBucket to check if the S3 bucket exists and list objects in it.
  • s3:GetObject to check object metadata and download objects from S3 buckets.

Requires SQS Permissions

The "consumer" identity must have the following permissions on the queue:

  • sqs:ChangeMessageVisibility
  • sqs:ChangeMessageVisibilityBatch
  • sqs:DeleteMessage
  • sqs:DeleteMessageBatch
  • sqs:GetQueueAttributes
  • sqs:GetQueueUrl
  • sqs:ListQueues
  • `sqs:ReceiveMessage``

Typically, you should setup an IAM policy, create a user and apply the IAM policy to the user. A sample policy is as follows:

     {
       "Statement": [
         {
           "Action": [
             "sqs:ChangeMessageVisibility",
             "sqs:ChangeMessageVisibilityBatch",
             "sqs:GetQueueAttributes",
             "sqs:GetQueueUrl",
             "sqs:ListQueues",
             "sqs:SendMessage",
             "sqs:SendMessageBatch"
           ],
           "Effect": "Allow",
           "Resource": [
             "arn:aws:sqs:us-east-1:123456789012:Logstash"
           ]
         }
       ]
     }

This plugin supports cross account access with assume role

Requires STS Permissions

"AssumeRolePolicyDocument" : {
    "Version" : "2012-10-17",
    "Statement" : [ {
      "Effect" : "Allow",
      "Principal" : {
        "Service" : [ "ec2.amazonaws.com" ]
      },
      "Action" : [ "sts:AssumeRole" ]
    } ]
}

Installing

  • clone the repository
git clone [email protected]:innovia/logstash-input-s3-file-via-sqs.git
  • build the gem
gem build logstash-input-s3file-via-sqs.gemspec
  • Install plugin
./bin/plugin install logstash-input-s3file-via-sqs-{VERSION}.gem

Plugin Configuration Options

input {
    s3file_via_sqs {
        queue => "LogsSomeQueue"
        assume_role_arn => "arn:aws:iam::123456789012:role/Logstash-CrossAccount-Role"
        aws_queue_owner_id => "123456789012"
        temporary_directory => "/some/temporary/download/path"
    }
}
  • polling_frequency - how often to pull from SQS (number) in seconds
  • assume_role_arn - the full cross acount IAM roll arn like "arn:aws:iam::123456789012:role/Logstash-CrossAccount-Role"
  • queue - queue name
  • aws_queue_owner_id - the aws account id like 123456789012
  • temporary_directory - where to save the downloaded files

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.

logstash-input-s3file_via_sqs's People

Contributors

ph avatar torrancew avatar jsvd avatar electrical avatar suyograo avatar kesor avatar mspiegle avatar danielredoak avatar ycombinator avatar talevy avatar tedder avatar

Stargazers

Fabrice Bessettes avatar

Watchers

James Cloos avatar Max Rabin avatar  avatar  avatar Liron avatar  avatar Aryeh Schechter avatar Mo Kamioner avatar  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.