Tag: amazon cloudwatch

Amazon Cloudwatch日志过滤 – JSON语法

我有一个logging错误的AWS Lambda函数。 错误logging如下: console.error(err); 我正在尝试创build一个使用JSON日志过滤语法的Cloudwatchfilter: { $.errorType = "ValidationException" } 我可以看到日志中的错误 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… ] } 是否需要某种特殊设置或手动login到CloudWatch以支持JSONfilter语法? 我无法在CloudWatch文档中find任何信息。 文档: http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-logging.html http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/FilterAndPatternSyntax.html#d0e19372

如何将node.js日志从Elastic Beanstalk Docker应用程序发送到Cloudwatch Logs?

Amazon提供这些用于将Tomcat / Apache / nginx日志发送到Cloudwatch日志的现成文件,这些日志很好用。 http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/AWSHowTo.cloudwatchlogs.html 但是,为了我的目的,他们只发送nginx日志,这是不够的,不幸的是,他们也提供了零文件的文件格式。 我想要实现的是将Node.js日志从我的Docker应用程序发送到Cloudwatch(因为自动调节使得实例来来去去)。 所以像/var/log/eb-docker/containers/eb-current-app/add839a3b599-stdouterr.log中出现像/var/log/eb-docker/containers/eb-current-app/add839a3b599-stdouterr.log这样的文件。 所以,我到目前为止所尝试的是从上面的链接调整webrequestsconfiguration: ############################################################################## ## Sends docker logs to CloudWatch Logs ############################################################################## Mappings: CWLogs: ApplicationLogGroup: LogFile: "/var/log/eb-docker/containers/eb-current-app/*-stdouterr.log" TimestampFormat: "%Y-%m-%d %H:%M:%S" Outputs: ApplicationLogGroup: Description: "The name of the Cloudwatch Logs Log Group created for this environments web server access logs. You can specify this by setting the value for […]