Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Problems with the New Relic / AWS CloudWatch Log Lambda


#1

Attempting to setup the AWS CloudWatch Log integration following these instructions: ahttps://docs.newrelic.com/docs/logs/enable-logs/enable-logs/aws-cloudwatch-plugin-logs

I have no problem following these steps:

Install the New Relic Lambda

  1. From the AWS console, go to the Lambda section, select Create function , and select Serverless Application Repository .
  2. Search for newrelic and check the box that says " Show apps that create custom IAM roles or resource policies " to find the newrelic-log-ingestion Lambda. Follow the instructions in the Lambda’s documentation to deploy it. A SAM template will build the Lambda

However I immediately get this error message:

  • An error occurred while listing cloudwatch-logs relations: 2 validation errors detected: Value ‘’ at ‘logGroupName’ failed to satisfy constraint: Member must satisfy regular expression pattern: [.-_/#A-Za-z0-9]+; Value ‘’ at ‘logGroupName’ failed to satisfy constraint: Member must have length greater than or equal to 1 (Service: AWSLogs; Status Code: 400; Error Code: InvalidParameterException; Request ID: 13c03ccf-ceb4-421e-b913-b35e9aed216f)

If I ignore the issue and continue the setup:

Configure your Lambda function

I can setup my Key and the other environment variable and save the values.

Create a Lambda trigger

Also no problem here I can add triggers and select the appropriate CloudWatch Log Groups.

However the error persists and I don’t see any log data in New Relic.


Unable to import module 'function': No module named 'aiohttp'
#2

Hi @browlett, the validation error you reported can be safely ignored. It’s an AWS bug that we have reported to them and are waiting on a resolution for. As long as your integration is reporting correctly, then you can ignore the error. Let me know if you have any other questions or concerns. :slight_smile:


#3

Hello, I’m having the exact same issue. After I set up the trigger to my log group no logs are forwarded to New Relic. When I return to the function configuration page the same error message as posted above shows and the trigger is no longer showing in the designer panel.

In CloudTrail, I can see that the log group is properly subscribed but no logs are being sent to my New Relic account.


#4

Note the last sentence - I don’t see any log data in New Relic.

I can see the log data accumulate in CloudWatch Logs and the setup looks correct in AWS (minus the reported error).


#5

Happy New Year @browlett!

Sorry you’re still running into trouble with this. If you have already ensured that the log group is “Subscribed” to the log ingestion lambda you should also see a log line from the log-ingestion-lambda function saying Log entry sent. Response code 202. url: https://log-api.newrelic.com/log/v1. Note that this function may also be sending instrumentation data for Lambda instrumentation so you’ll want to be sure the log line has the log-api.newrelic.com endpoint and not cloud-collector.newrelic.com which is for the Lambda side. The response code should be a 202.


#6

Looking good now. I deleted an re-entered the environment variables for the lambda. Thanks for your help.


#7

Glad to hear it’s working for you now @browlett!


#8

Continuing the discussion from Problems with the New Relic / AWS CloudWatch Log Lambda:

Hello. I am also having issues getting this working. I have probably more than 30 different log groups happening at once. I added a few cloudwatch log groups and they add to the newrelic-log-ingestion lambda fine. when I refresh or go back to add more, I get the error above
An error occurred while listing cloudwatch-logs relations: 2 validation errors detected: Value '' at 'logGroupName' failed to satisfy constraint: Member must satisfy regular expression pattern: [\.\-_/#A-Za-z0-9]+; Value '' at 'logGroupName' failed to satisfy constraint: Member must have length greater than or equal to 1 (Service: AWSLogs; Status Code: 400; Error Code: InvalidParameterException; Request ID: xxx
At that point all the listed log groups I have added are gone from the trigger list and I can’t tell which ones are included any longer.
environment vars are listed as this.


when i have both booleans set to true i get
START RequestId: xxx Version: $LATEST Log entry sent. Response code: 202. url: https://cloud-collector.newrelic.com/aws/v1 Log entry sent. Response code: 202. url: https://log-api.newrelic.com/log/v1

any idea how i can resolve the triggers disappearing? which env variable should be set to false ? the documentation between nr.com and the lambda setup are contradictory. one says default:false for both, the other says one is true and one is false (can’t remember which one)


#9

I am seeing the same issue, and am also curious if there is a work around.


#10

Also seeing the same issue here… triggers keep disapeering