amazon-web-services - Logs Insights 中的 AWS CloudWatch 过滤器 @LogStream
问题描述
有没有办法只在小部件中过滤不包含特定日志消息的 @LogStream ?
我尝试使用带有一些过滤器的日志表,如: https ://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html 和: https ://docs.aws.amazon.com/AmazonCloudWatch /latest/logs/CWL_QuerySyntax.html#CWL_QuerySyntax-regex
据我了解,过滤器适用于消息,但我需要一种在日志流级别进行过滤和选择的方法。
尝试过这样的事情:
找到的字段 @logStream, strcontains(@logStream, "[INFO] - My message")
| 过滤器找到=0
| 显示@logStream
| 限制 20
但是过滤器不起作用,它正在显示所有消息。
谢谢!
解决方案
您的strcontains(@logStream, "[INFO] - My message") as found
部分查询对我来说看起来不正确。我认为你的意思是:strcontains(@message, "[INFO] - My message") as found
?
推荐阅读
- javascript - 如何通过在点后分配最后两位数将字符串转换为浮点数?
- java - Oreo ViewPager 显示来自外部存储文件路径的图像
- access-token - actions-on-google 隐式流程和 access_token 更改?
- ios - 在 iOS 应用中制作不规则形状的可点击片段
- ios - 故事板属性是 UIViewController 的属性吗?
- java - 在生成预签名 S3 URL 时如何使用 AWS Signature v4?
- c++ - 在声明后定义一个枚举变量
- c++ - 如何将 back_inserter 与转换相结合,C++
- operators - 相同类型的两个对象的未定义关系运算符 - VHDL
- javascript - 遍历 Json 数据并在 EJS 中打印