gpt4 book ai didi

regex - Graylog 正则表达式搜索文本中的数字

转载 作者:行者123 更新时间:2023-12-04 15:53:22 46 4
gpt4 key购买 nike

我使用 graylog 2.0 ( http://docs.graylog.org/en/2.0/pages/queries.html ),它非常有用。

我想优化我的全文搜索。目前我是:- 在 graylog 中搜索字符串开头的所有 full_message- 然后我将其导出到 excel- 拆分文本(文本到列)- 应用自动过滤器- 过滤任何时间 > 20

搜索模式:

full_message: "Running queue with*" 

搜索文本:

Network Queue: Running queue with id: dd82c225-fab7-44ce-9618-67d1ef332a03 and 1 items
Network Queue: Running queue with id: dd82c225-fab7-44ce-9618-67d1ef332a03 and 5 items
Network Queue: Running queue with id: dd82c225-fab7-44ce-9618-67d1ef332a03 and 25 items
Network Queue: Running queue with id: dd82c225-fab7-44ce-9618-67d1ef332a03 and 200 items

我想知道更好的 reg 搜索是否可以只列出项目 > 20 的任何记录。

例如搜索字符串将是

full_message: "Running queue with [insert better regex here]" 

谢谢

最佳答案

你可以使用模式

Running queue with id: \S+ and (?:\d{3,}|[3-9]\d|2[1-9])

那里的最后一组允许:

  • \d{3,} 任何三位数或更多数字,或
  • [3-9]\d 任何数字 30-99,或
  • 2[1-9] 任意数字 21-29

https://regex101.com/r/ctLvQD/1

关于regex - Graylog 正则表达式搜索文本中的数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52920940/

46 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com