查询cloudwatch中的相邻日志

问题描述

我在cloudwatch见解中有一个查询,该查询获取了一些我感兴趣的日志。但是,我想查询与感兴趣的日志相邻的日志。有办法吗?

这是我所拥有和我所需要的例子。

我有什么

// App Source Code
log.info("Starting to process special records!")
for record in special_records:
    log.info("current_record : " + record)
    process(record)
// CW query gets the records
fields @timestamp,@message
| filter @message like /current_record :/

我需要的是像这样的附加子句

fields @timestamp,@message
| filter @message like /current_record :/
| filter @adjacentMessage = 'Starting to process special records!'

注意-我意识到我应该使日志更易于grep,这就是现在的计划,但是我很好奇CW是否具有我无法在文档中找到的高级功能

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)