cloudwatch-to-papertrail icon indicating copy to clipboard operation
cloudwatch-to-papertrail copied to clipboard

TypeError: Cannot read property 'data' of undefined

Open ParthivSavani opened this issue 6 years ago • 1 comments

@pksunkara I have created new lambda function and trying to Test it, I am getting below error. Can you please help me to fix?

Lambda Management Console

ParthivSavani avatar May 20 '19 10:05 ParthivSavani

I think this will happen if the function is invoked without the expected CloudWatch payload as the event.

If you're manually testing, an event should look something like the following:

{
  "awslogs": {
    "data": "H4sIAAAAAAAAAHWPwQqCQBCGX0Xm7EFtK+smZBEUgXoLCdMhFtKV3akI8d0bLYmibvPPN3wz00CJxmQnTO41whwWQRIctmEcB6sQbFC3CjW3XW8kxpOpP+OC22d1Wml1qZkQGtoMsScxaczKN3plG8zlaHIta5KqWsozoTYw3/djzwhpLwivWFGHGpAFe7DL68JlBUk+l7KSN7tCOEJ4M3/qOI49vMHj+zCKdlFqLaU2ZHV2a4Ct/an0/ivdX8oYc1UVX860fQDQiMdxRQEAAA=="
  }
}

The exception was raised as awslogs.data does not exist in the event. Data should be base64 encoded logs.

kylef avatar May 20 '19 15:05 kylef