logstash-integration-aws 0.1.0.pre

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.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.PRE.MERGE.md +658 -0
  3. data/CHANGELOG.md +15 -0
  4. data/CONTRIBUTORS +40 -0
  5. data/Gemfile +11 -0
  6. data/LICENSE +202 -0
  7. data/NOTICE.TXT +5 -0
  8. data/README.md +205 -0
  9. data/docs/codec-cloudfront.asciidoc +53 -0
  10. data/docs/codec-cloudtrail.asciidoc +45 -0
  11. data/docs/index.asciidoc +38 -0
  12. data/docs/input-cloudwatch.asciidoc +320 -0
  13. data/docs/input-s3.asciidoc +346 -0
  14. data/docs/input-sqs.asciidoc +287 -0
  15. data/docs/output-cloudwatch.asciidoc +321 -0
  16. data/docs/output-s3.asciidoc +442 -0
  17. data/docs/output-sns.asciidoc +166 -0
  18. data/docs/output-sqs.asciidoc +242 -0
  19. data/lib/logstash/codecs/cloudfront.rb +84 -0
  20. data/lib/logstash/codecs/cloudtrail.rb +47 -0
  21. data/lib/logstash/inputs/cloudwatch.rb +338 -0
  22. data/lib/logstash/inputs/s3.rb +466 -0
  23. data/lib/logstash/inputs/sqs.rb +196 -0
  24. data/lib/logstash/outputs/cloudwatch.rb +346 -0
  25. data/lib/logstash/outputs/s3/file_repository.rb +121 -0
  26. data/lib/logstash/outputs/s3/path_validator.rb +18 -0
  27. data/lib/logstash/outputs/s3/size_and_time_rotation_policy.rb +24 -0
  28. data/lib/logstash/outputs/s3/size_rotation_policy.rb +26 -0
  29. data/lib/logstash/outputs/s3/temporary_file.rb +71 -0
  30. data/lib/logstash/outputs/s3/temporary_file_factory.rb +129 -0
  31. data/lib/logstash/outputs/s3/time_rotation_policy.rb +26 -0
  32. data/lib/logstash/outputs/s3/uploader.rb +74 -0
  33. data/lib/logstash/outputs/s3/writable_directory_validator.rb +17 -0
  34. data/lib/logstash/outputs/s3/write_bucket_permission_validator.rb +60 -0
  35. data/lib/logstash/outputs/s3.rb +405 -0
  36. data/lib/logstash/outputs/sns.rb +133 -0
  37. data/lib/logstash/outputs/sqs.rb +167 -0
  38. data/lib/logstash/plugin_mixins/aws_config/generic.rb +54 -0
  39. data/lib/logstash/plugin_mixins/aws_config/v2.rb +93 -0
  40. data/lib/logstash/plugin_mixins/aws_config.rb +8 -0
  41. data/logstash-integration-aws.gemspec +52 -0
  42. data/spec/codecs/cloudfront_spec.rb +92 -0
  43. data/spec/codecs/cloudtrail_spec.rb +56 -0
  44. data/spec/fixtures/aws_credentials_file_sample_test.yml +2 -0
  45. data/spec/fixtures/aws_temporary_credentials_file_sample_test.yml +3 -0
  46. data/spec/fixtures/cloudfront.log +4 -0
  47. data/spec/fixtures/compressed.log.gee.zip +0 -0
  48. data/spec/fixtures/compressed.log.gz +0 -0
  49. data/spec/fixtures/compressed.log.gzip +0 -0
  50. data/spec/fixtures/invalid_utf8.gbk.log +2 -0
  51. data/spec/fixtures/json.log +2 -0
  52. data/spec/fixtures/json_with_message.log +2 -0
  53. data/spec/fixtures/multiline.log +6 -0
  54. data/spec/fixtures/multiple_compressed_streams.gz +0 -0
  55. data/spec/fixtures/uncompressed.log +2 -0
  56. data/spec/inputs/cloudwatch_spec.rb +85 -0
  57. data/spec/inputs/s3_spec.rb +610 -0
  58. data/spec/inputs/sincedb_spec.rb +17 -0
  59. data/spec/inputs/sqs_spec.rb +324 -0
  60. data/spec/integration/cloudwatch_spec.rb +25 -0
  61. data/spec/integration/dynamic_prefix_spec.rb +92 -0
  62. data/spec/integration/gzip_file_spec.rb +62 -0
  63. data/spec/integration/gzip_size_rotation_spec.rb +63 -0
  64. data/spec/integration/outputs/sqs_spec.rb +98 -0
  65. data/spec/integration/restore_from_crash_spec.rb +67 -0
  66. data/spec/integration/s3_spec.rb +66 -0
  67. data/spec/integration/size_rotation_spec.rb +59 -0
  68. data/spec/integration/sqs_spec.rb +110 -0
  69. data/spec/integration/stress_test_spec.rb +60 -0
  70. data/spec/integration/time_based_rotation_with_constant_write_spec.rb +60 -0
  71. data/spec/integration/time_based_rotation_with_stale_write_spec.rb +64 -0
  72. data/spec/integration/upload_current_file_on_shutdown_spec.rb +51 -0
  73. data/spec/outputs/cloudwatch_spec.rb +38 -0
  74. data/spec/outputs/s3/file_repository_spec.rb +143 -0
  75. data/spec/outputs/s3/size_and_time_rotation_policy_spec.rb +77 -0
  76. data/spec/outputs/s3/size_rotation_policy_spec.rb +41 -0
  77. data/spec/outputs/s3/temporary_file_factory_spec.rb +89 -0
  78. data/spec/outputs/s3/temporary_file_spec.rb +47 -0
  79. data/spec/outputs/s3/time_rotation_policy_spec.rb +60 -0
  80. data/spec/outputs/s3/uploader_spec.rb +69 -0
  81. data/spec/outputs/s3/writable_directory_validator_spec.rb +40 -0
  82. data/spec/outputs/s3/write_bucket_permission_validator_spec.rb +49 -0
  83. data/spec/outputs/s3_spec.rb +232 -0
  84. data/spec/outputs/sns_spec.rb +160 -0
  85. data/spec/plugin_mixin/aws_config_spec.rb +217 -0
  86. data/spec/spec_helper.rb +8 -0
  87. data/spec/support/helpers.rb +119 -0
  88. data/spec/unit/outputs/sqs_spec.rb +247 -0
  89. metadata +467 -0
@@ -0,0 +1,287 @@
1
+ // :integration: aws
2
+ :plugin: sqs
3
+ :type: input
4
+ :default_codec: json
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
+ === Sqs input plugin
20
+
21
+ // include::{include_path}/plugin_header-integration.asciidoc[]
22
+
23
+ ==== Description
24
+
25
+
26
+ Pull events from an Amazon Web Services Simple Queue Service (SQS) queue.
27
+
28
+ SQS is a simple, scalable queue system that is part of the
29
+ Amazon Web Services suite of tools.
30
+
31
+ Although SQS is similar to other queuing systems like AMQP, it
32
+ uses a custom API and requires that you have an AWS account.
33
+ See http://aws.amazon.com/sqs/ for more details on how SQS works,
34
+ what the pricing schedule looks like and how to setup a queue.
35
+
36
+ To use this plugin, you *must*:
37
+
38
+ * Have an AWS account
39
+ * Setup an SQS queue
40
+ * Create an identity that has access to consume messages from the queue.
41
+
42
+ The "consumer" identity must have the following permissions on the queue:
43
+
44
+ * `sqs:ChangeMessageVisibility`
45
+ * `sqs:ChangeMessageVisibilityBatch`
46
+ * `sqs:DeleteMessage`
47
+ * `sqs:DeleteMessageBatch`
48
+ * `sqs:GetQueueAttributes`
49
+ * `sqs:GetQueueUrl`
50
+ * `sqs:ListQueues`
51
+ * `sqs:ReceiveMessage`
52
+
53
+ Typically, you should setup an IAM policy, create a user and apply the IAM policy to the user.
54
+ A sample policy is as follows:
55
+ [source,json]
56
+ {
57
+ "Statement": [
58
+ {
59
+ "Action": [
60
+ "sqs:ChangeMessageVisibility",
61
+ "sqs:ChangeMessageVisibilityBatch",
62
+ "sqs:DeleteMessage",
63
+ "sqs:DeleteMessageBatch",
64
+ "sqs:GetQueueAttributes",
65
+ "sqs:GetQueueUrl",
66
+ "sqs:ListQueues",
67
+ "sqs:ReceiveMessage"
68
+ ],
69
+ "Effect": "Allow",
70
+ "Resource": [
71
+ "arn:aws:sqs:us-east-1:123456789012:Logstash"
72
+ ]
73
+ }
74
+ ]
75
+ }
76
+
77
+ See http://aws.amazon.com/iam/ for more details on setting up AWS identities.
78
+
79
+
80
+ [id="plugins-{type}s-{plugin}-options"]
81
+ ==== Sqs Input Configuration Options
82
+
83
+ This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
84
+
85
+ [cols="<,<,<",options="header",]
86
+ |=======================================================================
87
+ |Setting |Input type|Required
88
+ | <<plugins-{type}s-{plugin}-access_key_id>> |<<string,string>>|No
89
+ | <<plugins-{type}s-{plugin}-additional_settings>> |<<hash,hash>>|No
90
+ | <<plugins-{type}s-{plugin}-aws_credentials_file>> |<<string,string>>|No
91
+ | <<plugins-{type}s-{plugin}-endpoint>> |<<string,string>>|No
92
+ | <<plugins-{type}s-{plugin}-id_field>> |<<string,string>>|No
93
+ | <<plugins-{type}s-{plugin}-md5_field>> |<<string,string>>|No
94
+ | <<plugins-{type}s-{plugin}-polling_frequency>> |<<number,number>>|No
95
+ | <<plugins-{type}s-{plugin}-proxy_uri>> |<<string,string>>|No
96
+ | <<plugins-{type}s-{plugin}-queue>> |<<string,string>>|Yes
97
+ | <<plugins-{type}s-{plugin}-queue_owner_aws_account_id>> |<<string,string>>|No
98
+ | <<plugins-{type}s-{plugin}-region>> |<<string,string>>|No
99
+ | <<plugins-{type}s-{plugin}-role_arn>> |<<string,string>>|No
100
+ | <<plugins-{type}s-{plugin}-role_session_name>> |<<string,string>>|No
101
+ | <<plugins-{type}s-{plugin}-secret_access_key>> |<<string,string>>|No
102
+ | <<plugins-{type}s-{plugin}-sent_timestamp_field>> |<<string,string>>|No
103
+ | <<plugins-{type}s-{plugin}-session_token>> |<<string,string>>|No
104
+ | <<plugins-{type}s-{plugin}-threads>> |<<number,number>>|No
105
+ |=======================================================================
106
+
107
+ Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
108
+ input plugins.
109
+
110
+ &nbsp;
111
+
112
+ [id="plugins-{type}s-{plugin}-access_key_id"]
113
+ ===== `access_key_id`
114
+
115
+ * Value type is <<string,string>>
116
+ * There is no default value for this setting.
117
+
118
+ This plugin uses the AWS SDK and supports several ways to get credentials, which will be tried in this order:
119
+
120
+ 1. Static configuration, using `access_key_id` and `secret_access_key` params in logstash plugin config
121
+ 2. External credentials file specified by `aws_credentials_file`
122
+ 3. Environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
123
+ 4. Environment variables `AMAZON_ACCESS_KEY_ID` and `AMAZON_SECRET_ACCESS_KEY`
124
+ 5. IAM Instance Profile (available when running inside EC2)
125
+
126
+ [id="plugins-{type}s-{plugin}-additional_settings"]
127
+ ===== `additional_settings`
128
+
129
+ * Value type is <<hash,hash>>
130
+ * Default value is `{}`
131
+
132
+ Key-value pairs of settings and corresponding values used to parametrize
133
+ the connection to SQS. See full list in https://docs.aws.amazon.com/sdk-for-ruby/v2/api/Aws/SQS/Client.html[the AWS SDK documentation]. Example:
134
+
135
+ [source,ruby]
136
+ input {
137
+ sqs {
138
+ access_key_id => "1234"
139
+ secret_access_key => "secret"
140
+ queue => "logstash-test-queue"
141
+ additional_settings => {
142
+ force_path_style => true
143
+ follow_redirects => false
144
+ }
145
+ }
146
+ }
147
+
148
+ [id="plugins-{type}s-{plugin}-aws_credentials_file"]
149
+ ===== `aws_credentials_file`
150
+
151
+ * Value type is <<string,string>>
152
+ * There is no default value for this setting.
153
+
154
+ Path to YAML file containing a hash of AWS credentials.
155
+ This file will only be loaded if `access_key_id` and
156
+ `secret_access_key` aren't set. The contents of the
157
+ file should look like this:
158
+
159
+ [source,ruby]
160
+ ----------------------------------
161
+ :access_key_id: "12345"
162
+ :secret_access_key: "54321"
163
+ ----------------------------------
164
+
165
+ [id="plugins-{type}s-{plugin}-endpoint"]
166
+ ===== `endpoint`
167
+
168
+ * Value type is <<string,string>>
169
+ * There is no default value for this setting.
170
+
171
+ The endpoint to connect to. By default it is constructed using the value of `region`.
172
+ This is useful when connecting to S3 compatible services, but beware that these aren't
173
+ guaranteed to work correctly with the AWS SDK.
174
+
175
+ [id="plugins-{type}s-{plugin}-id_field"]
176
+ ===== `id_field`
177
+
178
+ * Value type is <<string,string>>
179
+ * There is no default value for this setting.
180
+
181
+ Name of the event field in which to store the SQS message ID
182
+
183
+ [id="plugins-{type}s-{plugin}-md5_field"]
184
+ ===== `md5_field`
185
+
186
+ * Value type is <<string,string>>
187
+ * There is no default value for this setting.
188
+
189
+ Name of the event field in which to store the SQS message MD5 checksum
190
+
191
+ [id="plugins-{type}s-{plugin}-polling_frequency"]
192
+ ===== `polling_frequency`
193
+
194
+ * Value type is <<number,number>>
195
+ * Default value is `20`
196
+
197
+ Polling frequency, default is 20 seconds
198
+
199
+ [id="plugins-{type}s-{plugin}-proxy_uri"]
200
+ ===== `proxy_uri`
201
+
202
+ * Value type is <<string,string>>
203
+ * There is no default value for this setting.
204
+
205
+ URI to proxy server if required
206
+
207
+ [id="plugins-{type}s-{plugin}-queue"]
208
+ ===== `queue`
209
+
210
+ * This is a required setting.
211
+ * Value type is <<string,string>>
212
+ * There is no default value for this setting.
213
+
214
+ 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.
215
+
216
+ [id="plugins-{type}s-{plugin}-queue_owner_aws_account_id"]
217
+ ===== `queue_owner_aws_account_id`
218
+
219
+ * Value type is <<string,string>>
220
+ * There is no default value for this setting.
221
+
222
+ ID of the AWS account owning the queue if you want to use a https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-basic-examples-of-sqs-policies.html#grant-two-permissions-to-one-account[cross-account queue] with embedded policy. Note that AWS SDK only support numerical account ID and not account aliases.
223
+
224
+ [id="plugins-{type}s-{plugin}-region"]
225
+ ===== `region`
226
+
227
+ * Value type is <<string,string>>
228
+ * Default value is `"us-east-1"`
229
+
230
+ The AWS Region
231
+
232
+ [id="plugins-{type}s-{plugin}-role_arn"]
233
+ ===== `role_arn`
234
+
235
+ * Value type is <<string,string>>
236
+ * There is no default value for this setting.
237
+
238
+ The AWS IAM Role to assume, if any.
239
+ This is used to generate temporary credentials, typically for cross-account access.
240
+ See the https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html[AssumeRole API documentation] for more information.
241
+
242
+ [id="plugins-{type}s-{plugin}-role_session_name"]
243
+ ===== `role_session_name`
244
+
245
+ * Value type is <<string,string>>
246
+ * Default value is `"logstash"`
247
+
248
+ Session name to use when assuming an IAM role.
249
+
250
+ [id="plugins-{type}s-{plugin}-secret_access_key"]
251
+ ===== `secret_access_key`
252
+
253
+ * Value type is <<string,string>>
254
+ * There is no default value for this setting.
255
+
256
+ The AWS Secret Access Key
257
+
258
+ [id="plugins-{type}s-{plugin}-sent_timestamp_field"]
259
+ ===== `sent_timestamp_field`
260
+
261
+ * Value type is <<string,string>>
262
+ * There is no default value for this setting.
263
+
264
+ Name of the event field in which to store the SQS message Sent Timestamp
265
+
266
+ [id="plugins-{type}s-{plugin}-session_token"]
267
+ ===== `session_token`
268
+
269
+ * Value type is <<string,string>>
270
+ * There is no default value for this setting.
271
+
272
+ The AWS Session token for temporary credential
273
+
274
+ [id="plugins-{type}s-{plugin}-threads"]
275
+ ===== `threads`
276
+
277
+ * Value type is <<number,number>>
278
+ * Default value is `1`
279
+
280
+
281
+
282
+
283
+
284
+ [id="plugins-{type}s-{plugin}-common-options"]
285
+ include::{include_path}/{type}.asciidoc[]
286
+
287
+ :default_codec!:
@@ -0,0 +1,321 @@
1
+ // :integration: aws
2
+ :plugin: cloudwatch
3
+ :type: output
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 output plugin
20
+
21
+ // include::{include_path}/plugin_header-integration.asciidoc[]
22
+
23
+ ==== Description
24
+
25
+ This output lets you aggregate and send metric data to AWS CloudWatch
26
+
27
+ ==== Summary:
28
+ This plugin is intended to be used on a logstash indexer agent (but that
29
+ is not the only way, see below.) In the intended scenario, one cloudwatch
30
+ output plugin is configured, on the logstash indexer node, with just AWS API
31
+ credentials, and possibly a region and/or a namespace. The output looks
32
+ for fields present in events, and when it finds them, it uses them to
33
+ calculate aggregate statistics. If the `metricname` option is set in this
34
+ output, then any events which pass through it will be aggregated & sent to
35
+ CloudWatch, but that is not recommended. The intended use is to NOT set the
36
+ metricname option here, and instead to add a `CW_metricname` field (and other
37
+ fields) to only the events you want sent to CloudWatch.
38
+
39
+ When events pass through this output they are queued for background
40
+ aggregation and sending, which happens every minute by default. The
41
+ queue has a maximum size, and when it is full aggregated statistics will be
42
+ sent to CloudWatch ahead of schedule. Whenever this happens a warning
43
+ message is written to logstash's log. If you see this you should increase
44
+ the `queue_size` configuration option to avoid the extra API calls. The queue
45
+ is emptied every time we send data to CloudWatch.
46
+
47
+ Note: when logstash is stopped the queue is destroyed before it can be processed.
48
+ This is a known limitation of logstash and will hopefully be addressed in a
49
+ future version.
50
+
51
+ ==== Details:
52
+ There are two ways to configure this plugin, and they can be used in
53
+ combination: event fields & per-output defaults
54
+
55
+ Event Field configuration...
56
+ You add fields to your events in inputs & filters and this output reads
57
+ those fields to aggregate events. The names of the fields read are
58
+ configurable via the `field_*` options.
59
+
60
+ Per-output defaults...
61
+ You set universal defaults in this output plugin's configuration, and
62
+ if an event does not have a field for that option then the default is
63
+ used.
64
+
65
+ Notice, the event fields take precedence over the per-output defaults.
66
+
67
+ At a minimum events must have a "metric name" to be sent to CloudWatch.
68
+ This can be achieved either by providing a default here OR by adding a
69
+ `CW_metricname` field. By default, if no other configuration is provided
70
+ besides a metric name, then events will be counted (Unit: Count, Value: 1)
71
+ by their metric name (either a default or from their `CW_metricname` field)
72
+
73
+ Other fields which can be added to events to modify the behavior of this
74
+ plugin are, `CW_namespace`, `CW_unit`, `CW_value`, and
75
+ `CW_dimensions`. All of these field names are configurable in
76
+ this output. You can also set per-output defaults for any of them.
77
+ See below for details.
78
+
79
+ Read more about http://aws.amazon.com/cloudwatch/[AWS CloudWatch],
80
+ and the specific of API endpoint this output uses,
81
+ http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html[PutMetricData]
82
+
83
+ [id="plugins-{type}s-{plugin}-options"]
84
+ ==== Cloudwatch Output Configuration Options
85
+
86
+ This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
87
+
88
+ [cols="<,<,<",options="header",]
89
+ |=======================================================================
90
+ |Setting |Input type|Required
91
+ | <<plugins-{type}s-{plugin}-access_key_id>> |<<string,string>>|No
92
+ | <<plugins-{type}s-{plugin}-aws_credentials_file>> |<<string,string>>|No
93
+ | <<plugins-{type}s-{plugin}-batch_size>> |<<number,number>>|No
94
+ | <<plugins-{type}s-{plugin}-dimensions>> |<<hash,hash>>|No
95
+ | <<plugins-{type}s-{plugin}-field_dimensions>> |<<string,string>>|No
96
+ | <<plugins-{type}s-{plugin}-field_metricname>> |<<string,string>>|No
97
+ | <<plugins-{type}s-{plugin}-field_namespace>> |<<string,string>>|No
98
+ | <<plugins-{type}s-{plugin}-field_unit>> |<<string,string>>|No
99
+ | <<plugins-{type}s-{plugin}-field_value>> |<<string,string>>|No
100
+ | <<plugins-{type}s-{plugin}-metricname>> |<<string,string>>|No
101
+ | <<plugins-{type}s-{plugin}-namespace>> |<<string,string>>|No
102
+ | <<plugins-{type}s-{plugin}-proxy_uri>> |<<string,string>>|No
103
+ | <<plugins-{type}s-{plugin}-queue_size>> |<<number,number>>|No
104
+ | <<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
105
+ | <<plugins-{type}s-{plugin}-secret_access_key>> |<<string,string>>|No
106
+ | <<plugins-{type}s-{plugin}-session_token>> |<<string,string>>|No
107
+ | <<plugins-{type}s-{plugin}-timeframe>> |<<string,string>>|No
108
+ | <<plugins-{type}s-{plugin}-unit>> |<<string,string>>, one of `["Seconds", "Microseconds", "Milliseconds", "Bytes", "Kilobytes", "Megabytes", "Gigabytes", "Terabytes", "Bits", "Kilobits", "Megabits", "Gigabits", "Terabits", "Percent", "Count", "Bytes/Second", "Kilobytes/Second", "Megabytes/Second", "Gigabytes/Second", "Terabytes/Second", "Bits/Second", "Kilobits/Second", "Megabits/Second", "Gigabits/Second", "Terabits/Second", "Count/Second", "None"]`|No
109
+ | <<plugins-{type}s-{plugin}-value>> |<<string,string>>|No
110
+ |=======================================================================
111
+
112
+ Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
113
+ output plugins.
114
+
115
+ &nbsp;
116
+
117
+ [id="plugins-{type}s-{plugin}-access_key_id"]
118
+ ===== `access_key_id`
119
+
120
+ * Value type is <<string,string>>
121
+ * There is no default value for this setting.
122
+
123
+ This plugin uses the AWS SDK and supports several ways to get credentials, which will be tried in this order:
124
+
125
+ 1. Static configuration, using `access_key_id` and `secret_access_key` params in logstash plugin config
126
+ 2. External credentials file specified by `aws_credentials_file`
127
+ 3. Environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
128
+ 4. Environment variables `AMAZON_ACCESS_KEY_ID` and `AMAZON_SECRET_ACCESS_KEY`
129
+ 5. IAM Instance Profile (available when running inside EC2)
130
+
131
+ [id="plugins-{type}s-{plugin}-aws_credentials_file"]
132
+ ===== `aws_credentials_file`
133
+
134
+ * Value type is <<string,string>>
135
+ * There is no default value for this setting.
136
+
137
+ Path to YAML file containing a hash of AWS credentials.
138
+ This file will only be loaded if `access_key_id` and
139
+ `secret_access_key` aren't set. The contents of the
140
+ file should look like this:
141
+
142
+ [source,ruby]
143
+ ----------------------------------
144
+ :access_key_id: "12345"
145
+ :secret_access_key: "54321"
146
+ ----------------------------------
147
+
148
+
149
+ [id="plugins-{type}s-{plugin}-batch_size"]
150
+ ===== `batch_size`
151
+
152
+ * Value type is <<number,number>>
153
+ * Default value is `20`
154
+
155
+ How many data points can be given in one call to the CloudWatch API
156
+
157
+ [id="plugins-{type}s-{plugin}-dimensions"]
158
+ ===== `dimensions`
159
+
160
+ * Value type is <<hash,hash>>
161
+ * There is no default value for this setting.
162
+
163
+ The default dimensions [ name, value, ... ] to use for events which do not have a `CW_dimensions` field
164
+
165
+ [id="plugins-{type}s-{plugin}-field_dimensions"]
166
+ ===== `field_dimensions`
167
+
168
+ * Value type is <<string,string>>
169
+ * Default value is `"CW_dimensions"`
170
+
171
+ The name of the field used to set the dimensions on an event metric
172
+ The field named here, if present in an event, must have an array of
173
+ one or more key & value pairs, for example...
174
+ `add_field => [ "CW_dimensions", "Environment", "CW_dimensions", "prod" ]`
175
+ or, equivalently...
176
+ `add_field => [ "CW_dimensions", "Environment" ]`
177
+ `add_field => [ "CW_dimensions", "prod" ]`
178
+
179
+ [id="plugins-{type}s-{plugin}-field_metricname"]
180
+ ===== `field_metricname`
181
+
182
+ * Value type is <<string,string>>
183
+ * Default value is `"CW_metricname"`
184
+
185
+ The name of the field used to set the metric name on an event
186
+ The author of this plugin recommends adding this field to events in inputs &
187
+ filters rather than using the per-output default setting so that one output
188
+ plugin on your logstash indexer can serve all events (which of course had
189
+ fields set on your logstash shippers.)
190
+
191
+ [id="plugins-{type}s-{plugin}-field_namespace"]
192
+ ===== `field_namespace`
193
+
194
+ * Value type is <<string,string>>
195
+ * Default value is `"CW_namespace"`
196
+
197
+ The name of the field used to set a different namespace per event
198
+ Note: Only one namespace can be sent to CloudWatch per API call
199
+ so setting different namespaces will increase the number of API calls
200
+ and those cost money.
201
+
202
+ [id="plugins-{type}s-{plugin}-field_unit"]
203
+ ===== `field_unit`
204
+
205
+ * Value type is <<string,string>>
206
+ * Default value is `"CW_unit"`
207
+
208
+ The name of the field used to set the unit on an event metric
209
+
210
+ [id="plugins-{type}s-{plugin}-field_value"]
211
+ ===== `field_value`
212
+
213
+ * Value type is <<string,string>>
214
+ * Default value is `"CW_value"`
215
+
216
+ The name of the field used to set the value (float) on an event metric
217
+
218
+ [id="plugins-{type}s-{plugin}-metricname"]
219
+ ===== `metricname`
220
+
221
+ * Value type is <<string,string>>
222
+ * There is no default value for this setting.
223
+
224
+ The default metric name to use for events which do not have a `CW_metricname` field.
225
+ Beware: If this is provided then all events which pass through this output will be aggregated and
226
+ sent to CloudWatch, so use this carefully. Furthermore, when providing this option, you
227
+ will probably want to also restrict events from passing through this output using event
228
+ type, tag, and field matching
229
+
230
+ [id="plugins-{type}s-{plugin}-namespace"]
231
+ ===== `namespace`
232
+
233
+ * Value type is <<string,string>>
234
+ * Default value is `"Logstash"`
235
+
236
+ The default namespace to use for events which do not have a `CW_namespace` field
237
+
238
+ [id="plugins-{type}s-{plugin}-proxy_uri"]
239
+ ===== `proxy_uri`
240
+
241
+ * Value type is <<string,string>>
242
+ * There is no default value for this setting.
243
+
244
+ URI to proxy server if required
245
+
246
+ [id="plugins-{type}s-{plugin}-queue_size"]
247
+ ===== `queue_size`
248
+
249
+ * Value type is <<number,number>>
250
+ * Default value is `10000`
251
+
252
+ How many events to queue before forcing a call to the CloudWatch API ahead of `timeframe` schedule
253
+ Set this to the number of events-per-timeframe you will be sending to CloudWatch to avoid extra API calls
254
+
255
+ [id="plugins-{type}s-{plugin}-region"]
256
+ ===== `region`
257
+
258
+ * 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`
259
+ * Default value is `"us-east-1"`
260
+
261
+ The AWS Region
262
+
263
+ [id="plugins-{type}s-{plugin}-secret_access_key"]
264
+ ===== `secret_access_key`
265
+
266
+ * Value type is <<string,string>>
267
+ * There is no default value for this setting.
268
+
269
+ The AWS Secret Access Key
270
+
271
+ [id="plugins-{type}s-{plugin}-session_token"]
272
+ ===== `session_token`
273
+
274
+ * Value type is <<string,string>>
275
+ * There is no default value for this setting.
276
+
277
+ The AWS Session token for temporary credential
278
+
279
+ [id="plugins-{type}s-{plugin}-timeframe"]
280
+ ===== `timeframe`
281
+
282
+ * Value type is <<string,string>>
283
+ * Default value is `"1m"`
284
+
285
+ Constants
286
+ aggregate_key members
287
+ Units
288
+ How often to send data to CloudWatch
289
+ This does not affect the event timestamps, events will always have their
290
+ actual timestamp (to-the-minute) sent to CloudWatch.
291
+
292
+ We only call the API if there is data to send.
293
+
294
+ See the Rufus Scheduler docs for an https://github.com/jmettraux/rufus-scheduler#the-time-strings-understood-by-rufus-scheduler[explanation of allowed values]
295
+
296
+ [id="plugins-{type}s-{plugin}-unit"]
297
+ ===== `unit`
298
+
299
+ * Value can be any of: `Seconds`, `Microseconds`, `Milliseconds`, `Bytes`, `Kilobytes`, `Megabytes`, `Gigabytes`, `Terabytes`, `Bits`, `Kilobits`, `Megabits`, `Gigabits`, `Terabits`, `Percent`, `Count`, `Bytes/Second`, `Kilobytes/Second`, `Megabytes/Second`, `Gigabytes/Second`, `Terabytes/Second`, `Bits/Second`, `Kilobits/Second`, `Megabits/Second`, `Gigabits/Second`, `Terabits/Second`, `Count/Second`, `None`
300
+ * Default value is `"Count"`
301
+
302
+ The default unit to use for events which do not have a `CW_unit` field
303
+ If you set this option you should probably set the "value" option along with it
304
+
305
+ [id="plugins-{type}s-{plugin}-value"]
306
+ ===== `value`
307
+
308
+ * Value type is <<string,string>>
309
+ * Default value is `"1"`
310
+
311
+ The default value to use for events which do not have a `CW_value` field
312
+ If provided, this must be a string which can be converted to a float, for example...
313
+ "1", "2.34", ".5", and "0.67"
314
+ If you set this option you should probably set the `unit` option along with it
315
+
316
+
317
+
318
+ [id="plugins-{type}s-{plugin}-common-options"]
319
+ include::{include_path}/{type}.asciidoc[]
320
+
321
+ :default_codec!: