如何在 AWS Log Insights 中搜索任何字符串正则表达式?

How to search any string regular expression in AWS Log Insights?

我有消息过滤器

fields @timestamp, @message
| sort @timestamp desc
| filter @message ~= 'simple query'
| limit 20

我应该使用什么查询来搜索带有消息的结果:

simple query
simple query 1
simple query 2
simple query error
simple query etc...

非常感谢!

您有两个选择,即 strcontainslike 方法:

strcontains:

fields @timestamp, @message
| filter strcontains(@message, "simple query")
| sort @timestamp desc
| limit 20

喜欢:

fields @timestamp, @message
| filter @message like /simple query/
| sort @timestamp desc
| limit 20