You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aws/logs_monitoring/README.md
+53-47Lines changed: 53 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,10 @@ aliases:
12
12
13
13
The Datadog Forwarder is an AWS Lambda function that ships logs from AWS to Datadog, specifically:
14
14
15
-
- Forward CloudWatch and S3 logs.
16
-
- Forward logs from SNS, and Kinesis events to Datadog.
17
-
- Kinesis data stream events support CloudWatch logs only.
18
-
- Forward metrics, traces, and logs from AWS Lambda functions to Datadog. Datadog recommends to use [Datadog Lambda Extension][1] to monitor Lambda functions.
15
+
-Forward CloudWatch and S3 logs.
16
+
-Forward logs from SNS, and Kinesis events to Datadog.
17
+
-Kinesis data stream events support CloudWatch logs only.
18
+
-Forward metrics, traces, and logs from AWS Lambda functions to Datadog. Datadog recommends to use [Datadog Lambda Extension][1] to monitor Lambda functions.
19
19
20
20
For Serverless customers using the Forwarder to forward metrics, traces, and logs from AWS Lambda logs to Datadog, you should [migrate to the Datadog Lambda Extension][3] to collect telemetry directly from the Lambda execution environments. The Forwarder is still available for use in Serverless Monitoring, but will not be updated to support the latest features.
21
21
@@ -60,23 +60,23 @@ If you're using AWS Organizations, you can use CloudFormation StackSets to deplo
60
60
1. Deploy the Forwarder template using [CloudFormation StackSets][151] in the AWS Console.
61
61
2. In the **Permissions** section, optionally provide an IAM admin role ARN, or leave the default IAM execution role name (`AWSCloudFormationStackSetExecutionRole`).
62
62
3. In the **Specify template** section:
63
-
1. Select **Amazon S3 URL**.
64
-
1. Enter the Forwarder template URL: `https://datadog-cloudformation-template.s3.amazonaws.com/aws/forwarder/latest.yaml`.
65
-
1. Click **Next**.
63
+
1. Select **Amazon S3 URL**.
64
+
1. Enter the Forwarder template URL: `https://datadog-cloudformation-template.s3.amazonaws.com/aws/forwarder/latest.yaml`.
65
+
1. Click **Next**.
66
66
4. In the **Specify stack set details** section:
67
-
1. Provide a stack set name.
68
-
1. Provide a valid Datadog API key using **one** of the `DdApiKey`, `DdApiKeySecretArn`, or `DdApiKeySsmParameterName` fields.
69
-
1. Select the appropriate Datadog site in the `DdSite` field.
70
-
1. Optionally, configure other parameters.
71
-
1. Click **Next**.
67
+
1. Provide a stack set name.
68
+
1. Provide a valid Datadog API key using **one** of the `DdApiKey`, `DdApiKeySecretArn`, or `DdApiKeySsmParameterName` fields.
69
+
1. Select the appropriate Datadog site in the `DdSite` field.
70
+
1. Optionally, configure other parameters.
71
+
1. Click **Next**.
72
72
5. In the **Configure stack set options** section:
73
-
1. Optionally, configure the provided options.
74
-
1. Check the box under **Capabilities**.
75
-
1. Click **Next**.
73
+
1. Optionally, configure the provided options.
74
+
1. Check the box under **Capabilities**.
75
+
1. Click **Next**.
76
76
6. On the **Set deployment options** page:
77
-
1. Select **Deploy stacks in accounts** and enter your AWS account IDs.
78
-
1. Under **Specify regions**, add target regions where you want to deploy the Forwarder.
79
-
1. Click **Next**.
77
+
1. Select **Deploy stacks in accounts** and enter your AWS account IDs.
78
+
1. Under **Specify regions**, add target regions where you want to deploy the Forwarder.
79
+
1. Click **Next**.
80
80
7. Review the details, and click **Submit**.
81
81
82
82
#### Multiple accounts
@@ -87,15 +87,15 @@ If you're using AWS Organizations, you can use CloudFormation StackSets to deplo
87
87
2. Deploy from the organization management account using [CloudFormation StackSets][151].
88
88
3. In the **Permissions** section, choose **Service-managed permissions**. This option allows CloudFormation StackSets to create the necessary IAM roles in target accounts automatically.
89
89
4. In the **Specify template** section:
90
-
1. Select **Amazon S3 URL**.
91
-
1. Enter the Forwarder template URL: `https://datadog-cloudformation-template.s3.amazonaws.com/aws/forwarder/latest.yaml`.
92
-
1. Click **Next**.
90
+
1. Select **Amazon S3 URL**.
91
+
1. Enter the Forwarder template URL: `https://datadog-cloudformation-template.s3.amazonaws.com/aws/forwarder/latest.yaml`.
92
+
1. Click **Next**.
93
93
5. In the **Specify stack set details** section:
94
-
1. Provide a stack set name.
95
-
1. Provide a valid Datadog API key using **one** of the `DdApiKey`, `DdApiKeySecretArn`, or `DdApiKeySsmParameterName` fields.
96
-
1. Select the appropriate Datadog site in the `DdSite` field.
97
-
1. Optionally, configure other parameters.
98
-
1. Click **Next**.
94
+
1. Provide a stack set name.
95
+
1. Provide a valid Datadog API key using **one** of the `DdApiKey`, `DdApiKeySecretArn`, or `DdApiKeySsmParameterName` fields.
96
+
1. Select the appropriate Datadog site in the `DdSite` field.
97
+
1. Optionally, configure other parameters.
98
+
1. Click **Next**.
99
99
6. Choose **Deploy to organization** and specify target organizational units (OUs) or individual accounts, along with the regions where you want to deploy the Forwarder.
100
100
101
101
**Note**: Regardless of whether you specify organizational units or individual accounts, you must [set up triggers][155] after the Forwarder is deployed.
@@ -184,10 +184,10 @@ If you encounter issues upgrading to the latest version, check the Troubleshooti
184
184
185
185
Key breaking changes in v5.0.0:
186
186
187
-
-**Log filtering behavior changed**: `IncludeAtMatch` and `ExcludeAtMatch` now match against the log message only, not the entire JSON structure
188
-
-**TCP transport removed**: `DD_USE_TCP` parameter removed, all logs must use HTTP/HTTPS
189
-
-**PrivateLink variable removed**: `DD_USE_PRIVATE_LINK` removed (PrivateLink is still supported via `DdUseVPC`)
190
-
-**New tag enrichment**: Backend-based tag enrichment enabled by default via `DdEnrichS3Tags` and `DdEnrichCloudwatchTags`, reducing forwarder costs
187
+
-**Log filtering behavior changed**: `IncludeAtMatch` and `ExcludeAtMatch` now match against the log message only, not the entire JSON structure
188
+
-**TCP transport removed**: `DD_USE_TCP` parameter removed, all logs must use HTTP/HTTPS
189
+
-**PrivateLink variable removed**: `DD_USE_PRIVATE_LINK` removed (PrivateLink is still supported via `DdUseVPC`)
190
+
-**New tag enrichment**: Backend-based tag enrichment enabled by default via `DdEnrichS3Tags` and `DdEnrichCloudwatchTags`, reducing forwarder costs
191
191
192
192
### Upgrade an older version to 4.13.0+
193
193
@@ -361,13 +361,13 @@ If you must deploy the Forwarder to a VPC without direct public internet access,
361
361
4. Ensure the `DdFetchLambdaTags`, `DdFetchStepFunctionsTags`, and `DdFetchS3Tags` options are disabled, because AWS VPC does not yet offer an endpoint for the Resource Groups Tagging API.
362
362
5. If you are using HAProxy or NGINX:
363
363
364
-
- Set `DdApiUrl` to `http://<proxy_host>:3834` or `https://<proxy_host>:3834`.
365
-
- Set `DdTraceIntakeUrl` to `http://<proxy_host>:3835` or `https://<proxy_host>:3835`.
366
-
- Set `DdUrl` to `<proxy_host>` and `DdPort` to `3837`.
364
+
- Set `DdApiUrl` to `http://<proxy_host>:3834` or `https://<proxy_host>:3834`.
365
+
- Set `DdTraceIntakeUrl` to `http://<proxy_host>:3835` or `https://<proxy_host>:3835`.
366
+
- Set `DdUrl` to `<proxy_host>` and `DdPort` to `3837`.
367
367
368
368
Otherwise, if you are using Web Proxy:
369
369
370
-
- Set `DdHttpProxyURL` to your proxy endpoint, for example: `http://<proxy_host>:<port>`, or, if your proxy has a username and password, `http://<username>:<password>@<proxy_host>:<port>`.
370
+
- Set `DdHttpProxyURL` to your proxy endpoint, for example: `http://<proxy_host>:<port>`, or, if your proxy has a username and password, `http://<username>:<password>@<proxy_host>:<port>`.
371
371
372
372
7. Set `DdNoSsl` to `true` if connecting to the proxy using `http`.
373
373
8. Set `DdSkipSslValidation` to `true` if connecting to the proxy using `https` with a self-signed certificate.
@@ -423,6 +423,9 @@ Datadog recommends using at least 10 reserved concurrency, but this defaults to
423
423
`DdTags`
424
424
: Add custom tags to forwarded logs, comma-delimited string, no trailing comma, such as `env:prod,stack:classic`.
425
425
426
+
`DdSource`
427
+
: Override the `ddsource` attribute for all logs forwarded by Lambda Forwarder. By default, the Forwarder automatically detects the source based on the log origin (for example: `lambda`, `s3`, `cloudwatch`, `rds`). When set, all logs will use the specified source value instead, and a `source_overridden:true` tag will be added to the logs.
428
+
426
429
`DdMultilineLogRegexPattern`
427
430
: Use the supplied regular expression to detect for a new log line for multiline logs from S3, such as `\d{2}\/\d{2}\/\d{4}` for multiline logs beginning with pattern "11/10/2014".
428
431
@@ -473,10 +476,10 @@ Filtering rules are applied to the log message. However, transformations applied
473
476
474
477
Some examples of regular expressions that can be used for log filtering:
475
478
476
-
- Include (or exclude) Lambda platform logs: `(START|END) RequestId:\s`. Datadog recommends keeping the `REPORT` logs, as they are used to populate the invocations list in the serverless function views.
477
-
- Include CloudTrail error messages only: `errorMessage`.
478
-
- Include only logs containing an HTTP 4XX or 5XX error code: `\b[4|5][0-9][0-9]\b`.
479
-
- Include only CloudWatch logs where the `message` field contains a specific JSON key/value pair: `"awsRegion":"us-east-1"`.
479
+
- Include (or exclude) Lambda platform logs: `(START|END) RequestId:\s`. Datadog recommends keeping the `REPORT` logs, as they are used to populate the invocations list in the serverless function views.
480
+
- Include CloudTrail error messages only: `errorMessage`.
481
+
- Include only logs containing an HTTP 4XX or 5XX error code: `\b[4|5][0-9][0-9]\b`.
482
+
- Include only CloudWatch logs where the `message` field contains a specific JSON key/value pair: `"awsRegion":"us-east-1"`.
480
483
481
484
To test different patterns against your logs, turn on [debug logs](#troubleshooting).
482
485
@@ -601,6 +604,9 @@ Datadog recommends using at least 10 reserved concurrency, but this defaults to
601
604
`DD_TAGS`
602
605
: Add custom tags to forwarded logs, comma-delimited string, no trailing comma, such as `env:prod,stack:classic`.
603
606
607
+
`DD_SOURCE`
608
+
: Override the `ddsource` attribute for all logs forwarded by Lambda Forwarder. By default, the Forwarder automatically detects the source based on the log origin (for example: `lambda`, `s3`, `cloudwatch`, `rds`). When set, all logs will use the specified source value instead, and a `source_overridden:true` tag will be added to the logs.
609
+
604
610
`DD_MULTILINE_LOG_REGEX_PATTERN`
605
611
: Use the supplied regular expression to detect for a new log line for multiline logs from S3, such as `\d{2}\/\d{2}\/\d{4}` for multiline logs beginning with pattern "11/10/2014".
606
612
@@ -651,10 +657,10 @@ Filtering rules are applied to the log message as read by the forwarder. Using a
651
657
652
658
Some examples of regular expressions that can be used for log filtering:
653
659
654
-
- Include (or exclude) Lambda platform logs: `(START|END) RequestId:\s`. Datadog recommends keeping the `REPORT` logs, as they are used to populate the invocations list in the serverless function views.
655
-
- Include CloudTrail error messages only: `errorMessage`.
656
-
- Include only logs containing an HTTP 4XX or 5XX error code: `\b[4|5][0-9][0-9]\b`.
657
-
- Include only CloudWatch logs where the `message` field contains a specific JSON key/value pair: `"awsRegion":"us-east-1"`.
660
+
- Include (or exclude) Lambda platform logs: `(START|END) RequestId:\s`. Datadog recommends keeping the `REPORT` logs, as they are used to populate the invocations list in the serverless function views.
661
+
- Include CloudTrail error messages only: `errorMessage`.
662
+
- Include only logs containing an HTTP 4XX or 5XX error code: `\b[4|5][0-9][0-9]\b`.
663
+
- Include only CloudWatch logs where the `message` field contains a specific JSON key/value pair: `"awsRegion":"us-east-1"`.
658
664
659
665
To test different patterns against your logs, turn on [debug logs](#troubleshooting).
660
666
@@ -756,12 +762,12 @@ To deploy the CloudFormation Stack with the default options, you need to have th
756
762
757
763
The following capabilities are required when creating a CloudFormation stack:
758
764
759
-
- CAPABILITY_AUTO_EXPAND, because the forwarder template uses macros such as the [AWS SAM macro][23].
760
-
- CAPABILTY_IAM/NAMED_IAM, because the Forwarder creates IAM roles.
765
+
- CAPABILITY_AUTO_EXPAND, because the forwarder template uses macros such as the [AWS SAM macro][23].
766
+
- CAPABILTY_IAM/NAMED_IAM, because the Forwarder creates IAM roles.
761
767
762
768
The CloudFormation Stack creates following IAM roles:
763
769
764
-
- ForwarderRole: The execution role for the Forwarder Lambda functiontoread logs from S3, fetch your Datadog API key from Secrets Manager, and write its own logs.
770
+
- ForwarderRole: The execution role for the Forwarder Lambda functiontoread logs from S3, fetch your Datadog API key from Secrets Manager, and write its own logs.
765
771
766
772
**IAM statements**
767
773
@@ -789,7 +795,7 @@ The CloudFormation Stack creates following IAM roles:
789
795
]
790
796
```
791
797
792
-
- `ForwarderZipCopierRole`: The execution role for the ForwarderZipCopier Lambda functionto download the Forwarder deployment ZIP file to a S3 bucket.
798
+
- `ForwarderZipCopierRole`: The execution role for the ForwarderZipCopier Lambda functionto download the Forwarder deployment ZIP file to a S3 bucket.
793
799
794
800
**IAM statements**:
795
801
@@ -826,7 +832,7 @@ The value of the `service` tag is determined based on multiple inputs. These inp
826
832
827
833
Additional helpful documentation, links, and articles:
828
834
829
-
- [Send AWS Services Logs With The Datadog Lambda Function][2]
835
+
- [Send AWS Services Logs With The Datadog Lambda Function][2]
Copy file name to clipboardExpand all lines: aws/logs_monitoring/template.yaml
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,10 @@ Parameters:
75
75
Type: String
76
76
Default: ""
77
77
Description: Add custom tags to forwarded logs, comma-delimited string, no trailing comma, e.g., env:prod,stack:classic
78
+
DdSource:
79
+
Type: String
80
+
Default: ""
81
+
Description: Override the source attribute for all logs forwarded by Lambda Forwarder. By default, the Forwarder automatically detects the source based on the log origin (e.g., lambda, s3, cloudwatch, rds). When set, all logs will use the specified source value instead, and a source_overridden:true tag will be added to the logs.
0 commit comments