logstash-input-sqs 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/CONTRIBUTORS +1 -0
- data/docs/index.asciidoc +219 -0
- data/lib/logstash/inputs/sqs/patch.rb +21 -0
- data/lib/logstash/inputs/sqs.rb +7 -0
- data/logstash-input-sqs.gemspec +2 -2
- data/spec/inputs/sqs_spec.rb +1 -1
- data/spec/integration/sqs_spec.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14851d6496ebf90774a2d559f8a82c3cccfe21e1
|
4
|
+
data.tar.gz: d734170d3d4116663bb445bdb4d830ecb1683a7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84b5ecc02db5cd15a409923df221578cd193e5631932c6f158d47a28ad0bd1b20ce490fb3dea42ebd0f6b03c902d406d348b46311e3009ce4fd86b04a6fc3a51
|
7
|
+
data.tar.gz: 2c968877567c0eb5f0f67e630f1348683a8f01e60a9ca5a1fae9d07a9f70a5c5f59b03aed3b58a275c4dc5442a04854a0571ce20766abf1063a3078b2ff749a6
|
data/CHANGELOG.md
CHANGED
data/CONTRIBUTORS
CHANGED
data/docs/index.asciidoc
ADDED
@@ -0,0 +1,219 @@
|
|
1
|
+
:plugin: sqs
|
2
|
+
:type: input
|
3
|
+
|
4
|
+
///////////////////////////////////////////
|
5
|
+
START - GENERATED VARIABLES, DO NOT EDIT!
|
6
|
+
///////////////////////////////////////////
|
7
|
+
:version: %VERSION%
|
8
|
+
:release_date: %RELEASE_DATE%
|
9
|
+
:changelog_url: %CHANGELOG_URL%
|
10
|
+
:include_path: ../../../logstash/docs/include
|
11
|
+
///////////////////////////////////////////
|
12
|
+
END - GENERATED VARIABLES, DO NOT EDIT!
|
13
|
+
///////////////////////////////////////////
|
14
|
+
|
15
|
+
[id="plugins-{type}-{plugin}"]
|
16
|
+
|
17
|
+
=== Sqs
|
18
|
+
|
19
|
+
include::{include_path}/plugin_header.asciidoc[]
|
20
|
+
|
21
|
+
==== Description
|
22
|
+
|
23
|
+
|
24
|
+
Pull events from an Amazon Web Services Simple Queue Service (SQS) queue.
|
25
|
+
|
26
|
+
SQS is a simple, scalable queue system that is part of the
|
27
|
+
Amazon Web Services suite of tools.
|
28
|
+
|
29
|
+
Although SQS is similar to other queuing systems like AMQP, it
|
30
|
+
uses a custom API and requires that you have an AWS account.
|
31
|
+
See http://aws.amazon.com/sqs/ for more details on how SQS works,
|
32
|
+
what the pricing schedule looks like and how to setup a queue.
|
33
|
+
|
34
|
+
To use this plugin, you *must*:
|
35
|
+
|
36
|
+
* Have an AWS account
|
37
|
+
* Setup an SQS queue
|
38
|
+
* Create an identify that has access to consume messages from the queue.
|
39
|
+
|
40
|
+
The "consumer" identity must have the following permissions on the queue:
|
41
|
+
|
42
|
+
* `sqs:ChangeMessageVisibility`
|
43
|
+
* `sqs:ChangeMessageVisibilityBatch`
|
44
|
+
* `sqs:DeleteMessage`
|
45
|
+
* `sqs:DeleteMessageBatch`
|
46
|
+
* `sqs:GetQueueAttributes`
|
47
|
+
* `sqs:GetQueueUrl`
|
48
|
+
* `sqs:ListQueues`
|
49
|
+
* `sqs:ReceiveMessage`
|
50
|
+
|
51
|
+
Typically, you should setup an IAM policy, create a user and apply the IAM policy to the user.
|
52
|
+
A sample policy is as follows:
|
53
|
+
[source,json]
|
54
|
+
{
|
55
|
+
"Statement": [
|
56
|
+
{
|
57
|
+
"Action": [
|
58
|
+
"sqs:ChangeMessageVisibility",
|
59
|
+
"sqs:ChangeMessageVisibilityBatch",
|
60
|
+
"sqs:GetQueueAttributes",
|
61
|
+
"sqs:GetQueueUrl",
|
62
|
+
"sqs:ListQueues",
|
63
|
+
"sqs:SendMessage",
|
64
|
+
"sqs:SendMessageBatch"
|
65
|
+
],
|
66
|
+
"Effect": "Allow",
|
67
|
+
"Resource": [
|
68
|
+
"arn:aws:sqs:us-east-1:123456789012:Logstash"
|
69
|
+
]
|
70
|
+
}
|
71
|
+
]
|
72
|
+
}
|
73
|
+
|
74
|
+
See http://aws.amazon.com/iam/ for more details on setting up AWS identities.
|
75
|
+
|
76
|
+
|
77
|
+
[id="plugins-{type}s-{plugin}-options"]
|
78
|
+
==== Sqs Input Configuration Options
|
79
|
+
|
80
|
+
This plugin supports the following configuration options plus the <<plugins-{type}s-common-options>> described later.
|
81
|
+
|
82
|
+
[cols="<,<,<",options="header",]
|
83
|
+
|=======================================================================
|
84
|
+
|Setting |Input type|Required
|
85
|
+
| <<plugins-{type}s-{plugin}-access_key_id>> |<<string,string>>|No
|
86
|
+
| <<plugins-{type}s-{plugin}-aws_credentials_file>> |<<string,string>>|No
|
87
|
+
| <<plugins-{type}s-{plugin}-id_field>> |<<string,string>>|No
|
88
|
+
| <<plugins-{type}s-{plugin}-md5_field>> |<<string,string>>|No
|
89
|
+
| <<plugins-{type}s-{plugin}-polling_frequency>> |<<number,number>>|No
|
90
|
+
| <<plugins-{type}s-{plugin}-proxy_uri>> |<<string,string>>|No
|
91
|
+
| <<plugins-{type}s-{plugin}-queue>> |<<string,string>>|Yes
|
92
|
+
| <<plugins-{type}s-{plugin}-region>> |<<string,string>>, one of `["us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-central-1", "eu-west-1", "eu-west-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ap-northeast-2", "sa-east-1", "us-gov-west-1", "cn-north-1", "ap-south-1", "ca-central-1"]`|No
|
93
|
+
| <<plugins-{type}s-{plugin}-secret_access_key>> |<<string,string>>|No
|
94
|
+
| <<plugins-{type}s-{plugin}-sent_timestamp_field>> |<<string,string>>|No
|
95
|
+
| <<plugins-{type}s-{plugin}-session_token>> |<<string,string>>|No
|
96
|
+
| <<plugins-{type}s-{plugin}-threads>> |<<number,number>>|No
|
97
|
+
|=======================================================================
|
98
|
+
|
99
|
+
Also see <<plugins-{type}s-common-options>> for a list of options supported by all
|
100
|
+
input plugins.
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
[id="plugins-{type}s-{plugin}-access_key_id"]
|
105
|
+
===== `access_key_id`
|
106
|
+
|
107
|
+
* Value type is <<string,string>>
|
108
|
+
* There is no default value for this setting.
|
109
|
+
|
110
|
+
This plugin uses the AWS SDK and supports several ways to get credentials, which will be tried in this order:
|
111
|
+
|
112
|
+
1. Static configuration, using `access_key_id` and `secret_access_key` params in logstash plugin config
|
113
|
+
2. External credentials file specified by `aws_credentials_file`
|
114
|
+
3. Environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
|
115
|
+
4. Environment variables `AMAZON_ACCESS_KEY_ID` and `AMAZON_SECRET_ACCESS_KEY`
|
116
|
+
5. IAM Instance Profile (available when running inside EC2)
|
117
|
+
|
118
|
+
[id="plugins-{type}s-{plugin}-aws_credentials_file"]
|
119
|
+
===== `aws_credentials_file`
|
120
|
+
|
121
|
+
* Value type is <<string,string>>
|
122
|
+
* There is no default value for this setting.
|
123
|
+
|
124
|
+
Path to YAML file containing a hash of AWS credentials.
|
125
|
+
This file will only be loaded if `access_key_id` and
|
126
|
+
`secret_access_key` aren't set. The contents of the
|
127
|
+
file should look like this:
|
128
|
+
|
129
|
+
[source,ruby]
|
130
|
+
----------------------------------
|
131
|
+
:access_key_id: "12345"
|
132
|
+
:secret_access_key: "54321"
|
133
|
+
----------------------------------
|
134
|
+
|
135
|
+
|
136
|
+
[id="plugins-{type}s-{plugin}-id_field"]
|
137
|
+
===== `id_field`
|
138
|
+
|
139
|
+
* Value type is <<string,string>>
|
140
|
+
* There is no default value for this setting.
|
141
|
+
|
142
|
+
Name of the event field in which to store the SQS message ID
|
143
|
+
|
144
|
+
[id="plugins-{type}s-{plugin}-md5_field"]
|
145
|
+
===== `md5_field`
|
146
|
+
|
147
|
+
* Value type is <<string,string>>
|
148
|
+
* There is no default value for this setting.
|
149
|
+
|
150
|
+
Name of the event field in which to store the SQS message MD5 checksum
|
151
|
+
|
152
|
+
[id="plugins-{type}s-{plugin}-polling_frequency"]
|
153
|
+
===== `polling_frequency`
|
154
|
+
|
155
|
+
* Value type is <<number,number>>
|
156
|
+
* Default value is `20`
|
157
|
+
|
158
|
+
Polling frequency, default is 20 seconds
|
159
|
+
|
160
|
+
[id="plugins-{type}s-{plugin}-proxy_uri"]
|
161
|
+
===== `proxy_uri`
|
162
|
+
|
163
|
+
* Value type is <<string,string>>
|
164
|
+
* There is no default value for this setting.
|
165
|
+
|
166
|
+
URI to proxy server if required
|
167
|
+
|
168
|
+
[id="plugins-{type}s-{plugin}-queue"]
|
169
|
+
===== `queue`
|
170
|
+
|
171
|
+
* This is a required setting.
|
172
|
+
* Value type is <<string,string>>
|
173
|
+
* There is no default value for this setting.
|
174
|
+
|
175
|
+
Name of the SQS Queue name to pull messages from. Note that this is just the name of the queue, not the URL or ARN.
|
176
|
+
|
177
|
+
[id="plugins-{type}s-{plugin}-region"]
|
178
|
+
===== `region`
|
179
|
+
|
180
|
+
* Value can be any of: `us-east-1`, `us-east-2`, `us-west-1`, `us-west-2`, `eu-central-1`, `eu-west-1`, `eu-west-2`, `ap-southeast-1`, `ap-southeast-2`, `ap-northeast-1`, `ap-northeast-2`, `sa-east-1`, `us-gov-west-1`, `cn-north-1`, `ap-south-1`, `ca-central-1`
|
181
|
+
* Default value is `"us-east-1"`
|
182
|
+
|
183
|
+
The AWS Region
|
184
|
+
|
185
|
+
[id="plugins-{type}s-{plugin}-secret_access_key"]
|
186
|
+
===== `secret_access_key`
|
187
|
+
|
188
|
+
* Value type is <<string,string>>
|
189
|
+
* There is no default value for this setting.
|
190
|
+
|
191
|
+
The AWS Secret Access Key
|
192
|
+
|
193
|
+
[id="plugins-{type}s-{plugin}-sent_timestamp_field"]
|
194
|
+
===== `sent_timestamp_field`
|
195
|
+
|
196
|
+
* Value type is <<string,string>>
|
197
|
+
* There is no default value for this setting.
|
198
|
+
|
199
|
+
Name of the event field in which to store the SQS message Sent Timestamp
|
200
|
+
|
201
|
+
[id="plugins-{type}s-{plugin}-session_token"]
|
202
|
+
===== `session_token`
|
203
|
+
|
204
|
+
* Value type is <<string,string>>
|
205
|
+
* There is no default value for this setting.
|
206
|
+
|
207
|
+
The AWS Session token for temporary credential
|
208
|
+
|
209
|
+
[id="plugins-{type}s-{plugin}-threads"]
|
210
|
+
===== `threads`
|
211
|
+
|
212
|
+
* Value type is <<number,number>>
|
213
|
+
* Default value is `1`
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
include::{include_path}/{type}.asciidoc[]
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# This patch was stolen from logstash-plugins/logstash-output-sqs#20.
|
2
|
+
#
|
3
|
+
# This patch is a workaround for a JRuby issue which has been fixed in JRuby
|
4
|
+
# 9000, but not in JRuby 1.7. See https://github.com/jruby/jruby/issues/3645
|
5
|
+
# and https://github.com/jruby/jruby/issues/3920. This is necessary because the
|
6
|
+
# `aws-sdk` is doing tricky name discovery to generate the correct error class.
|
7
|
+
#
|
8
|
+
# As per https://github.com/aws/aws-sdk-ruby/issues/1301#issuecomment-261115960,
|
9
|
+
# this patch may be short-lived anyway.
|
10
|
+
require 'aws-sdk'
|
11
|
+
|
12
|
+
begin
|
13
|
+
old_stderr = $stderr
|
14
|
+
$stderr = StringIO.new
|
15
|
+
|
16
|
+
module Aws
|
17
|
+
const_set(:SQS, Aws::SQS)
|
18
|
+
end
|
19
|
+
ensure
|
20
|
+
$stderr = old_stderr
|
21
|
+
end
|
data/lib/logstash/inputs/sqs.rb
CHANGED
@@ -5,6 +5,13 @@ require "logstash/namespace"
|
|
5
5
|
require "logstash/timestamp"
|
6
6
|
require "logstash/plugin_mixins/aws_config"
|
7
7
|
require "logstash/errors"
|
8
|
+
require 'logstash/inputs/sqs/patch'
|
9
|
+
|
10
|
+
# Forcibly load all modules marked to be lazily loaded.
|
11
|
+
#
|
12
|
+
# It is recommended that this is called prior to launching threads. See
|
13
|
+
# https://aws.amazon.com/blogs/developer/threading-with-the-aws-sdk-for-ruby/.
|
14
|
+
Aws.eager_autoload!
|
8
15
|
|
9
16
|
# Pull events from an Amazon Web Services Simple Queue Service (SQS) queue.
|
10
17
|
#
|
data/logstash-input-sqs.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-input-sqs'
|
3
|
-
s.version = '3.0.
|
3
|
+
s.version = '3.0.3'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = "Pull events from an Amazon Web Services Simple Queue Service (SQS) queue."
|
6
6
|
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.require_paths = ["lib"]
|
11
11
|
|
12
12
|
# Files
|
13
|
-
s.files = Dir[
|
13
|
+
s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "docs/**/*"]
|
14
14
|
|
15
15
|
# Tests
|
16
16
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
data/spec/inputs/sqs_spec.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
2
3
|
require "logstash/inputs/sqs"
|
3
4
|
require "logstash/errors"
|
4
5
|
require "logstash/event"
|
5
6
|
require "logstash/json"
|
6
7
|
require "aws-sdk"
|
7
|
-
require "spec_helper"
|
8
8
|
require "ostruct"
|
9
9
|
|
10
10
|
describe LogStash::Inputs::SQS do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-sqs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,7 +84,9 @@ files:
|
|
84
84
|
- LICENSE
|
85
85
|
- NOTICE.TXT
|
86
86
|
- README.md
|
87
|
+
- docs/index.asciidoc
|
87
88
|
- lib/logstash/inputs/sqs.rb
|
89
|
+
- lib/logstash/inputs/sqs/patch.rb
|
88
90
|
- logstash-input-sqs.gemspec
|
89
91
|
- spec/inputs/sqs_spec.rb
|
90
92
|
- spec/integration/sqs_spec.rb
|
@@ -112,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
114
|
version: '0'
|
113
115
|
requirements: []
|
114
116
|
rubyforge_project:
|
115
|
-
rubygems_version: 2.
|
117
|
+
rubygems_version: 2.4.8
|
116
118
|
signing_key:
|
117
119
|
specification_version: 4
|
118
120
|
summary: Pull events from an Amazon Web Services Simple Queue Service (SQS) queue.
|