【问题标题】:How to search for multiple strings in logs using aws cloudwatch log insights query?如何使用 aws cloudwatch 日志洞察查询在日志中搜索多个字符串?
【发布时间】:2022-01-05 12:24:35
【问题描述】:

对于我的 aws 日志组,我想编写一个 cloudwatch 日志洞察查询来搜索日志中的多个字符串。我尝试过这样的事情:

fields @timestamp, @message, @logStream
| filter @message like /(?i)\$\{jndi/
| filter @message like /(?i)\$\{\$\{lower\:j/
| sort @timestamp desc

但是,它只搜索第一个过滤器 /(?i)${jndi/ 。它不搜索第二个过滤器。谁能帮我看看如何使用一个查询搜索多个字符串?

我在 aws 文档和互联网上找不到任何示例

感谢您的帮助。

【问题讨论】:

    标签: amazon-cloudwatch amazon-cloudwatchlogs aws-cloudwatch-log-insights


    【解决方案1】:

    这唤醒了我:

    字段@timestamp、@message、@logStream |过滤@message like /(?i)(${jndi|${${lower:j|${${upper:j|${${::-j)|${/ |排序@timestamp desc

    【讨论】:

      猜你喜欢
      • 2021-03-17
      • 1970-01-01
      • 2021-04-30
      • 2020-05-16
      • 1970-01-01
      • 1970-01-01
      • 2019-07-13
      • 2021-09-09
      • 1970-01-01
      相关资源
      最近更新 更多