I have an AWS Lambda function which is logging errors. Errors are logged as such:
console.error(err);
I'm trying to create a Cloudwatch filter which uses their JSON log filtering syntax:
{ $.errorType = "ValidationException" }
I can see the error in the log
2015-11-24T20:26:02.852Z 76800706-2d78-45ed-9068-46ccccafe6af
{
"errorMessage": "1 validation error detected: Value '[]' at 'xxxxxx' failed to satisfy constraint: Member must have length greater than or equal to 1",
"errorType": "ValidationException",
"stackTrace": [
...etc...
]
}
Is there some sort of special setup or manual logging into CloudWatch required to support the JSON filter syntax? I cannot find any info in the CloudWatch docs.
Docs:
http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-logging.html