我正在尝试对不是那么新的AWS Cloudwatch Log Insights
我正在按照他们的文档使用
ispresent
功能过滤我的日志。
查询如下:
fields @timestamp, status
| filter ispresent(status) != 0
但这给了我一个错误(超级没有帮助
We are having trouble understanding the query
)
如何通过仅显示带有
status
字段的日志来过滤日志?
接受的答案对我不起作用,但你现在可以否定
ispresent()
:
fields @timestamp, status
| filter !ispresent(status)
过了一会儿,我想出了如何以一种黑客的方式做到这一点。
fields @timestamp, status, ispresent(status) as exist
| filter exist != 0
不是最好的方法(并且它违背了他们的文档),但是有效。
以下查询对我有用。
fields @timestamp, status
| filter isPresent(status)