[英]Can someone give me an example of a custom CloudWatch Event Pattern
我正在嘗試編寫將觸發 SSM 運行命令的自定義 CloudWatch 事件模式。 我遇到的問題是我不確定我應該如何編寫這個事件模式。 我查看了文檔,但我只是不明白如何做到這一點。 該文檔給出了一個示例,例如:
{
"source": [ "aws.ec2"]
}
據我了解,它將監視來自 EC2 服務的所有事件。 但是,我將如何觀察…… CloudWatch Logs 日志組中的特定消息?
回答原來的問題。 這是一個示例。
{
"source": ["aws.ec2"],
"detail-type": ["EC2 Instance State-change Notification"],
"detail": {
"state": ["running"]
}
}
您可以在https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html中的模式中找到更多信息。 絕對是Content-based Filtering with Event Patterns
頁面,例如
{
"time": [ { "prefix": "2017-10-02" } ],
"detail": {
"state": [ { "anything-but": "initializing" } ],
"c-count": [ { "numeric": [ ">", 0, "<=", 5 ] } ],
"d-count": [ { "numeric": [ "<", 10 ] } ],
"x-limit": [ { "anything-but": [ 100, 200, 300 ] } ]
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.