在Graylog中搜索带有破折号和数字的字符串?

时间:2019-01-31 20:11:29

标签: regex elasticsearch graylog2

我有找到适当的查询语法来搜索我的graylog消息下面的字符串的问题:

示例字符串:

/path-one/12/status
/path-one/18/status
/path-one/103/status
/path-one/9821/status

这些是在request_url字段。

我尝试了以下操作:

request_url:"/path\-one/.+/status" => Returns No results
request_url:/path-one/.+/status => Malformed in the following location and points to "/path-one/"
request_url:/path\-one/.+/status => Malformed in the following location and points to "/path\-one/"
request_url:/path-one/[0-9]+/status => Malformed in the following location and points to "[0-9]"

什么是正确的语法找到我想要的字符串,其中中间部分可以是正数?

1 个答案:

答案 0 :(得分:1)

您可以尝试

\/path-one\/[0-9]+\/status

请参见a demo on regex101.com