logstash-integration-aws 0.1.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.PRE.MERGE.md +658 -0
- data/CHANGELOG.md +15 -0
- data/CONTRIBUTORS +40 -0
- data/Gemfile +11 -0
- data/LICENSE +202 -0
- data/NOTICE.TXT +5 -0
- data/README.md +205 -0
- data/docs/codec-cloudfront.asciidoc +53 -0
- data/docs/codec-cloudtrail.asciidoc +45 -0
- data/docs/index.asciidoc +38 -0
- data/docs/input-cloudwatch.asciidoc +320 -0
- data/docs/input-s3.asciidoc +346 -0
- data/docs/input-sqs.asciidoc +287 -0
- data/docs/output-cloudwatch.asciidoc +321 -0
- data/docs/output-s3.asciidoc +442 -0
- data/docs/output-sns.asciidoc +166 -0
- data/docs/output-sqs.asciidoc +242 -0
- data/lib/logstash/codecs/cloudfront.rb +84 -0
- data/lib/logstash/codecs/cloudtrail.rb +47 -0
- data/lib/logstash/inputs/cloudwatch.rb +338 -0
- data/lib/logstash/inputs/s3.rb +466 -0
- data/lib/logstash/inputs/sqs.rb +196 -0
- data/lib/logstash/outputs/cloudwatch.rb +346 -0
- data/lib/logstash/outputs/s3/file_repository.rb +121 -0
- data/lib/logstash/outputs/s3/path_validator.rb +18 -0
- data/lib/logstash/outputs/s3/size_and_time_rotation_policy.rb +24 -0
- data/lib/logstash/outputs/s3/size_rotation_policy.rb +26 -0
- data/lib/logstash/outputs/s3/temporary_file.rb +71 -0
- data/lib/logstash/outputs/s3/temporary_file_factory.rb +129 -0
- data/lib/logstash/outputs/s3/time_rotation_policy.rb +26 -0
- data/lib/logstash/outputs/s3/uploader.rb +74 -0
- data/lib/logstash/outputs/s3/writable_directory_validator.rb +17 -0
- data/lib/logstash/outputs/s3/write_bucket_permission_validator.rb +60 -0
- data/lib/logstash/outputs/s3.rb +405 -0
- data/lib/logstash/outputs/sns.rb +133 -0
- data/lib/logstash/outputs/sqs.rb +167 -0
- data/lib/logstash/plugin_mixins/aws_config/generic.rb +54 -0
- data/lib/logstash/plugin_mixins/aws_config/v2.rb +93 -0
- data/lib/logstash/plugin_mixins/aws_config.rb +8 -0
- data/logstash-integration-aws.gemspec +52 -0
- data/spec/codecs/cloudfront_spec.rb +92 -0
- data/spec/codecs/cloudtrail_spec.rb +56 -0
- data/spec/fixtures/aws_credentials_file_sample_test.yml +2 -0
- data/spec/fixtures/aws_temporary_credentials_file_sample_test.yml +3 -0
- data/spec/fixtures/cloudfront.log +4 -0
- data/spec/fixtures/compressed.log.gee.zip +0 -0
- data/spec/fixtures/compressed.log.gz +0 -0
- data/spec/fixtures/compressed.log.gzip +0 -0
- data/spec/fixtures/invalid_utf8.gbk.log +2 -0
- data/spec/fixtures/json.log +2 -0
- data/spec/fixtures/json_with_message.log +2 -0
- data/spec/fixtures/multiline.log +6 -0
- data/spec/fixtures/multiple_compressed_streams.gz +0 -0
- data/spec/fixtures/uncompressed.log +2 -0
- data/spec/inputs/cloudwatch_spec.rb +85 -0
- data/spec/inputs/s3_spec.rb +610 -0
- data/spec/inputs/sincedb_spec.rb +17 -0
- data/spec/inputs/sqs_spec.rb +324 -0
- data/spec/integration/cloudwatch_spec.rb +25 -0
- data/spec/integration/dynamic_prefix_spec.rb +92 -0
- data/spec/integration/gzip_file_spec.rb +62 -0
- data/spec/integration/gzip_size_rotation_spec.rb +63 -0
- data/spec/integration/outputs/sqs_spec.rb +98 -0
- data/spec/integration/restore_from_crash_spec.rb +67 -0
- data/spec/integration/s3_spec.rb +66 -0
- data/spec/integration/size_rotation_spec.rb +59 -0
- data/spec/integration/sqs_spec.rb +110 -0
- data/spec/integration/stress_test_spec.rb +60 -0
- data/spec/integration/time_based_rotation_with_constant_write_spec.rb +60 -0
- data/spec/integration/time_based_rotation_with_stale_write_spec.rb +64 -0
- data/spec/integration/upload_current_file_on_shutdown_spec.rb +51 -0
- data/spec/outputs/cloudwatch_spec.rb +38 -0
- data/spec/outputs/s3/file_repository_spec.rb +143 -0
- data/spec/outputs/s3/size_and_time_rotation_policy_spec.rb +77 -0
- data/spec/outputs/s3/size_rotation_policy_spec.rb +41 -0
- data/spec/outputs/s3/temporary_file_factory_spec.rb +89 -0
- data/spec/outputs/s3/temporary_file_spec.rb +47 -0
- data/spec/outputs/s3/time_rotation_policy_spec.rb +60 -0
- data/spec/outputs/s3/uploader_spec.rb +69 -0
- data/spec/outputs/s3/writable_directory_validator_spec.rb +40 -0
- data/spec/outputs/s3/write_bucket_permission_validator_spec.rb +49 -0
- data/spec/outputs/s3_spec.rb +232 -0
- data/spec/outputs/sns_spec.rb +160 -0
- data/spec/plugin_mixin/aws_config_spec.rb +217 -0
- data/spec/spec_helper.rb +8 -0
- data/spec/support/helpers.rb +119 -0
- data/spec/unit/outputs/sqs_spec.rb +247 -0
- metadata +467 -0
@@ -0,0 +1,320 @@
|
|
1
|
+
// :integration: aws
|
2
|
+
:plugin: cloudwatch
|
3
|
+
:type: input
|
4
|
+
:default_codec: plain
|
5
|
+
|
6
|
+
///////////////////////////////////////////
|
7
|
+
START - GENERATED VARIABLES, DO NOT EDIT!
|
8
|
+
///////////////////////////////////////////
|
9
|
+
:version: %VERSION%
|
10
|
+
:release_date: %RELEASE_DATE%
|
11
|
+
:changelog_url: %CHANGELOG_URL%
|
12
|
+
:include_path: ../../../../logstash/docs/include
|
13
|
+
///////////////////////////////////////////
|
14
|
+
END - GENERATED VARIABLES, DO NOT EDIT!
|
15
|
+
///////////////////////////////////////////
|
16
|
+
|
17
|
+
[id="plugins-{type}s-{plugin}"]
|
18
|
+
|
19
|
+
=== Cloudwatch input plugin
|
20
|
+
|
21
|
+
// include::{include_path}/plugin_header-integration.asciidoc[]
|
22
|
+
|
23
|
+
==== Description
|
24
|
+
|
25
|
+
Pull events from the Amazon Web Services CloudWatch API.
|
26
|
+
|
27
|
+
To use this plugin, you *must* have an AWS account, and the following policy
|
28
|
+
|
29
|
+
Typically, you should setup an IAM policy, create a user and apply the IAM policy to the user.
|
30
|
+
A sample policy for EC2 metrics is as follows:
|
31
|
+
[source,json]
|
32
|
+
{
|
33
|
+
"Version": "2012-10-17",
|
34
|
+
"Statement": [
|
35
|
+
{
|
36
|
+
"Sid": "Stmt1444715676000",
|
37
|
+
"Effect": "Allow",
|
38
|
+
"Action": [
|
39
|
+
"cloudwatch:GetMetricStatistics",
|
40
|
+
"cloudwatch:ListMetrics"
|
41
|
+
],
|
42
|
+
"Resource": "*"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"Sid": "Stmt1444716576170",
|
46
|
+
"Effect": "Allow",
|
47
|
+
"Action": [
|
48
|
+
"ec2:DescribeInstances"
|
49
|
+
],
|
50
|
+
"Resource": "*"
|
51
|
+
}
|
52
|
+
]
|
53
|
+
}
|
54
|
+
|
55
|
+
See http://aws.amazon.com/iam/ for more details on setting up AWS identities.
|
56
|
+
|
57
|
+
===== Configuration examples
|
58
|
+
[source, ruby]
|
59
|
+
input {
|
60
|
+
cloudwatch {
|
61
|
+
namespace => "AWS/EC2"
|
62
|
+
metrics => [ "CPUUtilization" ]
|
63
|
+
filters => { "tag:Group" => "API-Production" }
|
64
|
+
region => "us-east-1"
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
[source, ruby]
|
69
|
+
input {
|
70
|
+
cloudwatch {
|
71
|
+
namespace => "AWS/EBS"
|
72
|
+
metrics => ["VolumeQueueLength"]
|
73
|
+
filters => { "tag:Monitoring" => "Yes" }
|
74
|
+
region => "us-east-1"
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
[source, ruby]
|
79
|
+
input {
|
80
|
+
cloudwatch {
|
81
|
+
namespace => "AWS/RDS"
|
82
|
+
metrics => ["CPUUtilization", "CPUCreditUsage"]
|
83
|
+
filters => { "EngineName" => "mysql" } # Only supports EngineName, DatabaseClass and DBInstanceIdentifier
|
84
|
+
region => "us-east-1"
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
[source, ruby]
|
89
|
+
input {
|
90
|
+
cloudwatch {
|
91
|
+
namespace => "sqlserver_test2"
|
92
|
+
metrics => [ "Memory Available Bytes"]
|
93
|
+
filters => {
|
94
|
+
InstanceId => "i-xxxxxxxxxxx"
|
95
|
+
objectname => "Memory"
|
96
|
+
}
|
97
|
+
combined => true
|
98
|
+
interval => 600
|
99
|
+
period => 300
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
|
104
|
+
[id="plugins-{type}s-{plugin}-options"]
|
105
|
+
==== Cloudwatch Input Configuration Options
|
106
|
+
|
107
|
+
This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
|
108
|
+
|
109
|
+
[cols="<,<,<",options="header",]
|
110
|
+
|=======================================================================
|
111
|
+
|Setting |Input type|Required
|
112
|
+
| <<plugins-{type}s-{plugin}-access_key_id>> |<<string,string>>|No
|
113
|
+
| <<plugins-{type}s-{plugin}-aws_credentials_file>> |<<string,string>>|No
|
114
|
+
| <<plugins-{type}s-{plugin}-combined>> |<<boolean,boolean>>|No
|
115
|
+
| <<plugins-{type}s-{plugin}-endpoint>> |<<string,string>>|No
|
116
|
+
| <<plugins-{type}s-{plugin}-filters>> |<<array,array>>|See <<plugins-{type}s-{plugin}-filters,note>>
|
117
|
+
| <<plugins-{type}s-{plugin}-interval>> |<<number,number>>|No
|
118
|
+
| <<plugins-{type}s-{plugin}-metrics>> |<<array,array>>|No
|
119
|
+
| <<plugins-{type}s-{plugin}-namespace>> |<<string,string>>|No
|
120
|
+
| <<plugins-{type}s-{plugin}-period>> |<<number,number>>|No
|
121
|
+
| <<plugins-{type}s-{plugin}-proxy_uri>> |<<string,string>>|No
|
122
|
+
| <<plugins-{type}s-{plugin}-region>> |<<string,string>>|No
|
123
|
+
| <<plugins-{type}s-{plugin}-role_arn>> |<<string,string>>|No
|
124
|
+
| <<plugins-{type}s-{plugin}-role_session_name>> |<<string,string>>|No
|
125
|
+
| <<plugins-{type}s-{plugin}-secret_access_key>> |<<string,string>>|No
|
126
|
+
| <<plugins-{type}s-{plugin}-session_token>> |<<string,string>>|No
|
127
|
+
| <<plugins-{type}s-{plugin}-statistics>> |<<array,array>>|No
|
128
|
+
| <<plugins-{type}s-{plugin}-use_ssl>> |<<boolean,boolean>>|No
|
129
|
+
|=======================================================================
|
130
|
+
|
131
|
+
Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
|
132
|
+
input plugins.
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
[id="plugins-{type}s-{plugin}-access_key_id"]
|
137
|
+
===== `access_key_id`
|
138
|
+
|
139
|
+
* Value type is <<string,string>>
|
140
|
+
* There is no default value for this setting.
|
141
|
+
|
142
|
+
This plugin uses the AWS SDK and supports several ways to get credentials, which will be tried in this order:
|
143
|
+
|
144
|
+
1. Static configuration, using `access_key_id` and `secret_access_key` params in logstash plugin config
|
145
|
+
2. External credentials file specified by `aws_credentials_file`
|
146
|
+
3. Environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
|
147
|
+
4. Environment variables `AMAZON_ACCESS_KEY_ID` and `AMAZON_SECRET_ACCESS_KEY`
|
148
|
+
5. IAM Instance Profile (available when running inside EC2)
|
149
|
+
|
150
|
+
[id="plugins-{type}s-{plugin}-aws_credentials_file"]
|
151
|
+
===== `aws_credentials_file`
|
152
|
+
|
153
|
+
* Value type is <<string,string>>
|
154
|
+
* There is no default value for this setting.
|
155
|
+
|
156
|
+
Path to YAML file containing a hash of AWS credentials.
|
157
|
+
This file will only be loaded if `access_key_id` and
|
158
|
+
`secret_access_key` aren't set. The contents of the
|
159
|
+
file should look like this:
|
160
|
+
|
161
|
+
[source,ruby]
|
162
|
+
----------------------------------
|
163
|
+
:access_key_id: "12345"
|
164
|
+
:secret_access_key: "54321"
|
165
|
+
----------------------------------
|
166
|
+
|
167
|
+
|
168
|
+
[id="plugins-{type}s-{plugin}-combined"]
|
169
|
+
===== `combined`
|
170
|
+
|
171
|
+
* Value type is <<boolean,boolean>>
|
172
|
+
* Default value is `false`
|
173
|
+
|
174
|
+
Use this for namespaces that need to combine the dimensions like S3 and SNS.
|
175
|
+
|
176
|
+
[id="plugins-{type}s-{plugin}-endpoint"]
|
177
|
+
===== `endpoint`
|
178
|
+
|
179
|
+
* Value type is <<string,string>>
|
180
|
+
* There is no default value for this setting.
|
181
|
+
|
182
|
+
The endpoint to connect to. By default it is constructed using the value of `region`.
|
183
|
+
This is useful when connecting to S3 compatible services, but beware that these aren't
|
184
|
+
guaranteed to work correctly with the AWS SDK.
|
185
|
+
|
186
|
+
[id="plugins-{type}s-{plugin}-filters"]
|
187
|
+
===== `filters`
|
188
|
+
|
189
|
+
* This setting can be required or optional. See note below.
|
190
|
+
* Value type is <<array,array>>
|
191
|
+
* There is no default value for this setting.
|
192
|
+
|
193
|
+
NOTE: This setting is optional when the namespace is `AWS/EC2`. Otherwise this is a required field.
|
194
|
+
|
195
|
+
Specify the filters to apply when fetching resources. Follow the AWS convention:
|
196
|
+
|
197
|
+
* Instances: { 'instance-id' => 'i-12344321' }
|
198
|
+
* Tags: { "tag:Environment" => "Production" }
|
199
|
+
* Volumes: { 'attachment.status' => 'attached' }
|
200
|
+
|
201
|
+
Each namespace uniquely support certain dimensions. Please consult the documentation
|
202
|
+
to ensure you're using valid filters.
|
203
|
+
|
204
|
+
[id="plugins-{type}s-{plugin}-interval"]
|
205
|
+
===== `interval`
|
206
|
+
|
207
|
+
* Value type is <<number,number>>
|
208
|
+
* Default value is `900`
|
209
|
+
|
210
|
+
Set how frequently CloudWatch should be queried
|
211
|
+
|
212
|
+
The default, `900`, means check every 15 minutes. Setting this value too low
|
213
|
+
(generally less than 300) results in no metrics being returned from CloudWatch.
|
214
|
+
|
215
|
+
[id="plugins-{type}s-{plugin}-metrics"]
|
216
|
+
===== `metrics`
|
217
|
+
|
218
|
+
* Value type is <<array,array>>
|
219
|
+
* Default value is `["CPUUtilization", "DiskReadOps", "DiskWriteOps", "NetworkIn", "NetworkOut"]`
|
220
|
+
|
221
|
+
Specify the metrics to fetch for the namespace. The defaults are AWS/EC2 specific. See http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/aws-namespaces.html
|
222
|
+
for the available metrics for other namespaces.
|
223
|
+
|
224
|
+
[id="plugins-{type}s-{plugin}-namespace"]
|
225
|
+
===== `namespace`
|
226
|
+
|
227
|
+
* Value type is <<string,string>>
|
228
|
+
* Default value is `"AWS/EC2"`
|
229
|
+
|
230
|
+
If undefined, LogStash will complain, even if codec is unused.
|
231
|
+
The service namespace of the metrics to fetch.
|
232
|
+
|
233
|
+
The default is for the EC2 service. See http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/aws-namespaces.html
|
234
|
+
for valid values.
|
235
|
+
|
236
|
+
[id="plugins-{type}s-{plugin}-period"]
|
237
|
+
===== `period`
|
238
|
+
|
239
|
+
* Value type is <<number,number>>
|
240
|
+
* Default value is `300`
|
241
|
+
|
242
|
+
Set the granularity of the returned datapoints.
|
243
|
+
|
244
|
+
Must be at least 60 seconds and in multiples of 60.
|
245
|
+
|
246
|
+
[id="plugins-{type}s-{plugin}-proxy_uri"]
|
247
|
+
===== `proxy_uri`
|
248
|
+
|
249
|
+
* Value type is <<string,string>>
|
250
|
+
* There is no default value for this setting.
|
251
|
+
|
252
|
+
URI to proxy server if required
|
253
|
+
|
254
|
+
[id="plugins-{type}s-{plugin}-region"]
|
255
|
+
===== `region`
|
256
|
+
|
257
|
+
* Value type is <<string,string>>
|
258
|
+
* Default value is `"us-east-1"`
|
259
|
+
|
260
|
+
The AWS Region
|
261
|
+
|
262
|
+
[id="plugins-{type}s-{plugin}-role_arn"]
|
263
|
+
===== `role_arn`
|
264
|
+
|
265
|
+
* Value type is <<string,string>>
|
266
|
+
* There is no default value for this setting.
|
267
|
+
|
268
|
+
The AWS IAM Role to assume, if any.
|
269
|
+
This is used to generate temporary credentials, typically for cross-account access.
|
270
|
+
See the https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html[AssumeRole API documentation] for more information.
|
271
|
+
|
272
|
+
[id="plugins-{type}s-{plugin}-role_session_name"]
|
273
|
+
===== `role_session_name`
|
274
|
+
|
275
|
+
* Value type is <<string,string>>
|
276
|
+
* Default value is `"logstash"`
|
277
|
+
|
278
|
+
Session name to use when assuming an IAM role.
|
279
|
+
|
280
|
+
[id="plugins-{type}s-{plugin}-secret_access_key"]
|
281
|
+
===== `secret_access_key`
|
282
|
+
|
283
|
+
* Value type is <<string,string>>
|
284
|
+
* There is no default value for this setting.
|
285
|
+
|
286
|
+
The AWS Secret Access Key
|
287
|
+
|
288
|
+
[id="plugins-{type}s-{plugin}-session_token"]
|
289
|
+
===== `session_token`
|
290
|
+
|
291
|
+
* Value type is <<string,string>>
|
292
|
+
* There is no default value for this setting.
|
293
|
+
|
294
|
+
The AWS Session token for temporary credential
|
295
|
+
|
296
|
+
[id="plugins-{type}s-{plugin}-statistics"]
|
297
|
+
===== `statistics`
|
298
|
+
|
299
|
+
* Value type is <<array,array>>
|
300
|
+
* Default value is `["SampleCount", "Average", "Minimum", "Maximum", "Sum"]`
|
301
|
+
|
302
|
+
Specify the statistics to fetch for each namespace
|
303
|
+
|
304
|
+
[id="plugins-{type}s-{plugin}-use_ssl"]
|
305
|
+
===== `use_ssl`
|
306
|
+
|
307
|
+
* Value type is <<boolean,boolean>>
|
308
|
+
* Default value is `true`
|
309
|
+
|
310
|
+
Make sure we require the V1 classes when including this module.
|
311
|
+
require 'aws-sdk' will load v2 classes.
|
312
|
+
Should we require (true) or disable (false) using SSL for communicating with the AWS API
|
313
|
+
The AWS SDK for Ruby defaults to SSL so we preserve that
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
[id="plugins-{type}s-{plugin}-common-options"]
|
318
|
+
include::{include_path}/{type}.asciidoc[]
|
319
|
+
|
320
|
+
:default_codec!:
|
@@ -0,0 +1,346 @@
|
|
1
|
+
// :integration: aws
|
2
|
+
:plugin: s3
|
3
|
+
:type: input
|
4
|
+
:default_codec: plain
|
5
|
+
|
6
|
+
///////////////////////////////////////////
|
7
|
+
START - GENERATED VARIABLES, DO NOT EDIT!
|
8
|
+
///////////////////////////////////////////
|
9
|
+
:version: %VERSION%
|
10
|
+
:release_date: %RELEASE_DATE%
|
11
|
+
:changelog_url: %CHANGELOG_URL%
|
12
|
+
:include_path: ../../../../logstash/docs/include
|
13
|
+
///////////////////////////////////////////
|
14
|
+
END - GENERATED VARIABLES, DO NOT EDIT!
|
15
|
+
///////////////////////////////////////////
|
16
|
+
|
17
|
+
[id="plugins-{type}s-{plugin}"]
|
18
|
+
|
19
|
+
=== S3 input plugin
|
20
|
+
|
21
|
+
// include::{include_path}/plugin_header-integration.asciidoc[]
|
22
|
+
|
23
|
+
==== Description
|
24
|
+
|
25
|
+
Stream events from files from a S3 bucket.
|
26
|
+
|
27
|
+
IMPORTANT: The S3 input plugin only supports AWS S3.
|
28
|
+
Other S3 compatible storage solutions are not supported.
|
29
|
+
|
30
|
+
Each line from each file generates an event.
|
31
|
+
Files ending in `.gz` are handled as gzip'ed files.
|
32
|
+
|
33
|
+
Files that are archived to AWS Glacier will be skipped.
|
34
|
+
|
35
|
+
[id="plugins-{type}s-{plugin}-ecs_metadata"]
|
36
|
+
==== Event Metadata and the Elastic Common Schema (ECS)
|
37
|
+
This plugin adds cloudfront metadata to event.
|
38
|
+
When ECS compatibility is disabled, the value is stored in the root level.
|
39
|
+
When ECS is enabled, the value is stored in the `@metadata` where it can be used by other plugins in your pipeline.
|
40
|
+
|
41
|
+
Here’s how ECS compatibility mode affects output.
|
42
|
+
[cols="<l,<l,e,<e"]
|
43
|
+
|=======================================================================
|
44
|
+
| ECS disabled | ECS v1 | Availability | Description
|
45
|
+
|
46
|
+
| cloudfront_fields | [@metadata][s3][cloudfront][fields] | available when the file is a CloudFront log | column names of log
|
47
|
+
| cloudfront_version | [@metadata][s3][cloudfront][version] | available when the file is a CloudFront log | version of log
|
48
|
+
|=======================================================================
|
49
|
+
|
50
|
+
[id="plugins-{type}s-{plugin}-options"]
|
51
|
+
==== S3 Input Configuration Options
|
52
|
+
|
53
|
+
This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
|
54
|
+
|
55
|
+
[cols="<,<,<",options="header",]
|
56
|
+
|=======================================================================
|
57
|
+
|Setting |Input type|Required
|
58
|
+
| <<plugins-{type}s-{plugin}-access_key_id>> |<<string,string>>|No
|
59
|
+
| <<plugins-{type}s-{plugin}-additional_settings>> |<<hash,hash>>|No
|
60
|
+
| <<plugins-{type}s-{plugin}-aws_credentials_file>> |<<string,string>>|No
|
61
|
+
| <<plugins-{type}s-{plugin}-backup_add_prefix>> |<<string,string>>|No
|
62
|
+
| <<plugins-{type}s-{plugin}-backup_to_bucket>> |<<string,string>>|No
|
63
|
+
| <<plugins-{type}s-{plugin}-backup_to_dir>> |<<string,string>>|No
|
64
|
+
| <<plugins-{type}s-{plugin}-bucket>> |<<string,string>>|Yes
|
65
|
+
| <<plugins-{type}s-{plugin}-delete>> |<<boolean,boolean>>|No
|
66
|
+
| <<plugins-{type}s-{plugin}-ecs_compatibility>> |<<string,string>>|No
|
67
|
+
| <<plugins-{type}s-{plugin}-endpoint>> |<<string,string>>|No
|
68
|
+
| <<plugins-{type}s-{plugin}-exclude_pattern>> |<<string,string>>|No
|
69
|
+
| <<plugins-{type}s-{plugin}-gzip_pattern>> |<<string,string>>|No
|
70
|
+
| <<plugins-{type}s-{plugin}-include_object_properties>> |<<boolean,boolean>>|No
|
71
|
+
| <<plugins-{type}s-{plugin}-interval>> |<<number,number>>|No
|
72
|
+
| <<plugins-{type}s-{plugin}-prefix>> |<<string,string>>|No
|
73
|
+
| <<plugins-{type}s-{plugin}-proxy_uri>> |<<string,string>>|No
|
74
|
+
| <<plugins-{type}s-{plugin}-region>> |<<string,string>>|No
|
75
|
+
| <<plugins-{type}s-{plugin}-role_arn>> |<<string,string>>|No
|
76
|
+
| <<plugins-{type}s-{plugin}-role_session_name>> |<<string,string>>|No
|
77
|
+
| <<plugins-{type}s-{plugin}-secret_access_key>> |<<string,string>>|No
|
78
|
+
| <<plugins-{type}s-{plugin}-session_token>> |<<string,string>>|No
|
79
|
+
| <<plugins-{type}s-{plugin}-sincedb_path>> |<<string,string>>|No
|
80
|
+
| <<plugins-{type}s-{plugin}-temporary_directory>> |<<string,string>>|No
|
81
|
+
| <<plugins-{type}s-{plugin}-watch_for_new_files>> |<<boolean,boolean>>|No
|
82
|
+
|=======================================================================
|
83
|
+
|
84
|
+
Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
|
85
|
+
input plugins.
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
[id="plugins-{type}s-{plugin}-access_key_id"]
|
90
|
+
===== `access_key_id`
|
91
|
+
|
92
|
+
* Value type is <<string,string>>
|
93
|
+
* There is no default value for this setting.
|
94
|
+
|
95
|
+
This plugin uses the AWS SDK and supports several ways to get credentials, which will be tried in this order:
|
96
|
+
|
97
|
+
1. Static configuration, using `access_key_id` and `secret_access_key` params in logstash plugin config
|
98
|
+
2. External credentials file specified by `aws_credentials_file`
|
99
|
+
3. Environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
|
100
|
+
4. Environment variables `AMAZON_ACCESS_KEY_ID` and `AMAZON_SECRET_ACCESS_KEY`
|
101
|
+
5. IAM Instance Profile (available when running inside EC2)
|
102
|
+
|
103
|
+
|
104
|
+
[id="plugins-{type}s-{plugin}-additional_settings"]
|
105
|
+
===== `additional_settings`
|
106
|
+
|
107
|
+
* Value type is <<hash,hash>>
|
108
|
+
* Default value is `{}`
|
109
|
+
|
110
|
+
Key-value pairs of settings and corresponding values used to parametrize
|
111
|
+
the connection to s3. See full list in https://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Client.html[the AWS SDK documentation]. Example:
|
112
|
+
|
113
|
+
[source,ruby]
|
114
|
+
input {
|
115
|
+
s3 {
|
116
|
+
access_key_id => "1234"
|
117
|
+
secret_access_key => "secret"
|
118
|
+
bucket => "logstash-test"
|
119
|
+
additional_settings => {
|
120
|
+
force_path_style => true
|
121
|
+
follow_redirects => false
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
[id="plugins-{type}s-{plugin}-aws_credentials_file"]
|
127
|
+
===== `aws_credentials_file`
|
128
|
+
|
129
|
+
* Value type is <<string,string>>
|
130
|
+
* There is no default value for this setting.
|
131
|
+
|
132
|
+
Path to YAML file containing a hash of AWS credentials.
|
133
|
+
This file will only be loaded if `access_key_id` and
|
134
|
+
`secret_access_key` aren't set. The contents of the
|
135
|
+
file should look like this:
|
136
|
+
|
137
|
+
[source,ruby]
|
138
|
+
----------------------------------
|
139
|
+
:access_key_id: "12345"
|
140
|
+
:secret_access_key: "54321"
|
141
|
+
----------------------------------
|
142
|
+
|
143
|
+
|
144
|
+
[id="plugins-{type}s-{plugin}-backup_add_prefix"]
|
145
|
+
===== `backup_add_prefix`
|
146
|
+
|
147
|
+
* Value type is <<string,string>>
|
148
|
+
* Default value is `nil`
|
149
|
+
|
150
|
+
Append a prefix to the key (full path including file name in s3) after processing.
|
151
|
+
If backing up to another (or the same) bucket, this effectively lets you
|
152
|
+
choose a new 'folder' to place the files in
|
153
|
+
|
154
|
+
[id="plugins-{type}s-{plugin}-backup_to_bucket"]
|
155
|
+
===== `backup_to_bucket`
|
156
|
+
|
157
|
+
* Value type is <<string,string>>
|
158
|
+
* Default value is `nil`
|
159
|
+
|
160
|
+
Name of a S3 bucket to backup processed files to.
|
161
|
+
|
162
|
+
[id="plugins-{type}s-{plugin}-backup_to_dir"]
|
163
|
+
===== `backup_to_dir`
|
164
|
+
|
165
|
+
* Value type is <<string,string>>
|
166
|
+
* Default value is `nil`
|
167
|
+
|
168
|
+
Path of a local directory to backup processed files to.
|
169
|
+
|
170
|
+
[id="plugins-{type}s-{plugin}-bucket"]
|
171
|
+
===== `bucket`
|
172
|
+
|
173
|
+
* This is a required setting.
|
174
|
+
* Value type is <<string,string>>
|
175
|
+
* There is no default value for this setting.
|
176
|
+
|
177
|
+
The name of the S3 bucket.
|
178
|
+
|
179
|
+
[id="plugins-{type}s-{plugin}-delete"]
|
180
|
+
===== `delete`
|
181
|
+
|
182
|
+
* Value type is <<boolean,boolean>>
|
183
|
+
* Default value is `false`
|
184
|
+
|
185
|
+
Whether to delete processed files from the original bucket.
|
186
|
+
|
187
|
+
[id="plugins-{type}s-{plugin}-ecs_compatibility"]
|
188
|
+
===== `ecs_compatibility`
|
189
|
+
|
190
|
+
* Value type is <<string,string>>
|
191
|
+
* Supported values are:
|
192
|
+
** `disabled`: does not use ECS-compatible field names
|
193
|
+
** `v1`,`v8`: uses metadata fields that are compatible with Elastic Common Schema
|
194
|
+
|
195
|
+
Controls this plugin's compatibility with the
|
196
|
+
{ecs-ref}[Elastic Common Schema (ECS)].
|
197
|
+
See <<plugins-{type}s-{plugin}-ecs_metadata>> for detailed information.
|
198
|
+
|
199
|
+
[id="plugins-{type}s-{plugin}-endpoint"]
|
200
|
+
===== `endpoint`
|
201
|
+
|
202
|
+
* Value type is <<string,string>>
|
203
|
+
* There is no default value for this setting.
|
204
|
+
|
205
|
+
The endpoint to connect to. By default it is constructed using the value of `region`.
|
206
|
+
This is useful when connecting to S3 compatible services, but beware that these aren't
|
207
|
+
guaranteed to work correctly with the AWS SDK.
|
208
|
+
|
209
|
+
[id="plugins-{type}s-{plugin}-exclude_pattern"]
|
210
|
+
===== `exclude_pattern`
|
211
|
+
|
212
|
+
* Value type is <<string,string>>
|
213
|
+
* Default value is `nil`
|
214
|
+
|
215
|
+
Ruby style regexp of keys to exclude from the bucket.
|
216
|
+
|
217
|
+
Note that files matching the pattern are skipped _after_ they have been listed.
|
218
|
+
Consider using <<plugins-{type}s-{plugin}-prefix>> instead where possible.
|
219
|
+
|
220
|
+
Example:
|
221
|
+
|
222
|
+
[source,ruby]
|
223
|
+
-----
|
224
|
+
"exclude_pattern" => "\/2020\/04\/"
|
225
|
+
-----
|
226
|
+
|
227
|
+
This pattern excludes all logs containing "/2020/04/" in the path.
|
228
|
+
|
229
|
+
|
230
|
+
[id="plugins-{type}s-{plugin}-gzip_pattern"]
|
231
|
+
===== `gzip_pattern`
|
232
|
+
|
233
|
+
* Value type is <<string,string>>
|
234
|
+
* Default value is `"\.gz(ip)?$"`
|
235
|
+
|
236
|
+
Regular expression used to determine whether an input file is in gzip format.
|
237
|
+
|
238
|
+
[id="plugins-{type}s-{plugin}-include_object_properties"]
|
239
|
+
===== `include_object_properties`
|
240
|
+
|
241
|
+
* Value type is <<boolean,boolean>>
|
242
|
+
* Default value is `false`
|
243
|
+
|
244
|
+
Whether or not to include the S3 object's properties (last_modified, content_type, metadata) into each Event at
|
245
|
+
`[@metadata][s3]`. Regardless of this setting, `[@metadata][s3][key]` will always be present.
|
246
|
+
|
247
|
+
[id="plugins-{type}s-{plugin}-interval"]
|
248
|
+
===== `interval`
|
249
|
+
|
250
|
+
* Value type is <<number,number>>
|
251
|
+
* Default value is `60`
|
252
|
+
|
253
|
+
Interval to wait between to check the file list again after a run is finished.
|
254
|
+
Value is in seconds.
|
255
|
+
|
256
|
+
[id="plugins-{type}s-{plugin}-prefix"]
|
257
|
+
===== `prefix`
|
258
|
+
|
259
|
+
* Value type is <<string,string>>
|
260
|
+
* Default value is `nil`
|
261
|
+
|
262
|
+
If specified, the prefix of filenames in the bucket must match (not a regexp)
|
263
|
+
|
264
|
+
[id="plugins-{type}s-{plugin}-proxy_uri"]
|
265
|
+
===== `proxy_uri`
|
266
|
+
|
267
|
+
* Value type is <<string,string>>
|
268
|
+
* There is no default value for this setting.
|
269
|
+
|
270
|
+
URI to proxy server if required
|
271
|
+
|
272
|
+
[id="plugins-{type}s-{plugin}-region"]
|
273
|
+
===== `region`
|
274
|
+
|
275
|
+
* Value type is <<string,string>>
|
276
|
+
* Default value is `"us-east-1"`
|
277
|
+
|
278
|
+
The AWS Region
|
279
|
+
|
280
|
+
[id="plugins-{type}s-{plugin}-role_arn"]
|
281
|
+
===== `role_arn`
|
282
|
+
|
283
|
+
* Value type is <<string,string>>
|
284
|
+
* There is no default value for this setting.
|
285
|
+
|
286
|
+
The AWS IAM Role to assume, if any.
|
287
|
+
This is used to generate temporary credentials, typically for cross-account access.
|
288
|
+
See the https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html[AssumeRole API documentation] for more information.
|
289
|
+
|
290
|
+
[id="plugins-{type}s-{plugin}-role_session_name"]
|
291
|
+
===== `role_session_name`
|
292
|
+
|
293
|
+
* Value type is <<string,string>>
|
294
|
+
* Default value is `"logstash"`
|
295
|
+
|
296
|
+
Session name to use when assuming an IAM role.
|
297
|
+
|
298
|
+
[id="plugins-{type}s-{plugin}-secret_access_key"]
|
299
|
+
===== `secret_access_key`
|
300
|
+
|
301
|
+
* Value type is <<string,string>>
|
302
|
+
* There is no default value for this setting.
|
303
|
+
|
304
|
+
The AWS Secret Access Key
|
305
|
+
|
306
|
+
[id="plugins-{type}s-{plugin}-session_token"]
|
307
|
+
===== `session_token`
|
308
|
+
|
309
|
+
* Value type is <<string,string>>
|
310
|
+
* There is no default value for this setting.
|
311
|
+
|
312
|
+
The AWS Session token for temporary credential
|
313
|
+
|
314
|
+
[id="plugins-{type}s-{plugin}-sincedb_path"]
|
315
|
+
===== `sincedb_path`
|
316
|
+
|
317
|
+
* Value type is <<string,string>>
|
318
|
+
* Default value is `nil`
|
319
|
+
|
320
|
+
Where to write the since database (keeps track of the date
|
321
|
+
the last handled file was added to S3). The default will write
|
322
|
+
sincedb files to in the directory '{path.data}/plugins/inputs/s3/'
|
323
|
+
|
324
|
+
If specified, this setting must be a filename path and not just a directory.
|
325
|
+
|
326
|
+
[id="plugins-{type}s-{plugin}-temporary_directory"]
|
327
|
+
===== `temporary_directory`
|
328
|
+
|
329
|
+
* Value type is <<string,string>>
|
330
|
+
* Default value is `"/tmp/logstash"`
|
331
|
+
|
332
|
+
Set the directory where logstash will store the tmp files before processing them.
|
333
|
+
|
334
|
+
[id="plugins-{type}s-{plugin}-watch_for_new_files"]
|
335
|
+
===== `watch_for_new_files`
|
336
|
+
|
337
|
+
* Value type is <<boolean,boolean>>
|
338
|
+
* Default value is `true`
|
339
|
+
|
340
|
+
Whether or not to watch for new files.
|
341
|
+
Disabling this option causes the input to close itself after processing the files from a single listing.
|
342
|
+
|
343
|
+
[id="plugins-{type}s-{plugin}-common-options"]
|
344
|
+
include::{include_path}/{type}.asciidoc[]
|
345
|
+
|
346
|
+
:default_codec!:
|