繁体   English   中英

FilterPattern for AWS 云观察订阅过滤器

[英]FilterPattern for AWS cloud watch subscription filter

我有两条日志行,我想获取它们。

第一个日志 -

2022-11-02 request sent => [xxxx........

第二个日志 -

2022-11-02 res received => [xxxx........

所以我在控制台上应用了以下过滤器模式并对其进行了测试,它运行良好。 - ?"request sent "?"res received"

但是当我在yaml配置文件上提供相同的过滤器模式时,它会在部署时抛出错误...

我试过了

FilterPattern: ?"request sent "?"res received & FilterPattern: '?"request sent "?"res received' . 但它不起作用。 什么是正确的写作方式。

你需要转义双引号

FilterPattern: ?\"request sent \" ?\"res received\"

要么

FilterPattern: "?\"request sent \" ?\"res received\""

请参阅: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html#matching-terms-events

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM