DataDog/datadog-serverless-functions

Feature request: Allow option to dynamically set the 'Service' and 'Host' attributes from an AWS CloudWatch log group

Opened this issue · 0 comments

We are trying to dynamically map the 'Host' and 'Service' attributes based on the AWS CloudWatch logGroup and logStream.

For example:
If the AWS loggroup:

  1. Starts with "/var/log" the Host attribute should map to logStream name and Service should be "ec2" in Datadog log explorer
  2. Starts with "/aws/lambda" the Host attribute should map to logGroup name and Service should be "lambda" Datadog log explorer

Currently this is only possible by following steps:

  1. Modify "parsing.py" and adding the custom code
  2. Create a zip and update the datadog-log-forwarder lambda function with the updated zip

This process is cumbersome and would be nice if this can be implemented easily. As we cannot add the tags in the logStream. Also this is not feasible for dynamically generated logGroups as it requires a lot of additional work in the application code.