amazon-web-services - 由日志事件触发的 AWS CloudWatch 规则

标签 amazon-web-services amazon-cloudwatch

我想创建将在创建日志事件时触发的 CloudWatch 规则。出于这个原因,我选择了 CloudWatch Logs 服务作为事件模式,但是当我尝试生成一些 Cloud Watch 日志时,规则没有被触发。我找不到任何使用 aws.logs 作为事件源的示例,因此我的问题是我做错了什么。 enter image description here

最佳答案

这是因为 logs 可用的唯一事件是 AWS API Call via CloudTrail。 CloudWatch Logs 不会在收到新日志条目时生成 CloudWatch 事件。

要使 Logs API 调用事件正常工作,您需要设置 CloudTrial trial .

但是,如果您想根据日志条目触发 lambda 函数,我建议您使用 subscription filters for lambda :

You can use subscriptions to get access to a real-time feed of log events from CloudWatch Logs and have it delivered to other services such as a Amazon Kinesis stream, Amazon Kinesis Data Firehose stream, or AWS Lambda for custom processing, analysis, or loading to other systems.

关于amazon-web-services - 由日志事件触发的 AWS CloudWatch 规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62141994/

相关文章:

amazon-web-services - 如何使用过滤策略从 SNS 主题中排除 cloudwatch 警报?

amazon-web-services - 在 Wait 步骤中取消 Step Function

amazon-web-services - 如何确保我的 http ://ec2-**-**-***. ap-south-1.compute.amazonaws.com 指向我的域?

amazon-web-services - AWS - CloudFormation - MalformedPolicyDocument - SHARR

amazon-web-services - 从 API 网关测试调用 lambda,但命中端点不会调用 lambda。 500 退回

amazon-web-services - 在 AWS CloudWatch 警报中配置 LoadBalancer

amazon-web-services - 如何从 AWS cloudwatch Input Transformer 创建 JSON

amazon-web-services - 如何为 WebSocket 协议(protocol)配置 AWS ELB 和 Nginx?

amazon-web-services - Cloudwatch VPC 接口(interface)端点超时

amazon-web-services - CloudWatch 日志数据存储在哪里?