gpt4 book ai didi

regex - 神交 - 如何获得 URIPATHPARAM?

转载 作者:行者123 更新时间:2023-12-01 14:16:21 25 4
gpt4 key购买 nike

根据logstash/grok documentation , 可以找到具有以下匹配模式的 URI

#Example log file 

55.3.244.1 GET /index.html 15824 0.043


#Example Grok match pattern
%{IP:client} %{WORD:method} %{URIPATHPARAM:request} %{NUMBER:bytes} %{NUMBER:duration}

我正在尝试获取一个用双引号括起来的 URI,根据 grokdebug.herokuap.com,这是无效的。

#My log file
Started POST "/main/builder.git/git-upload-pack" for 127.0.0.1 at 2014-02-13 22:37:10 +0000

#My grok match patterns
%{WORD:started} %{WORD:method} %{URIPATHPARAM:gitrepo}

# 0 results

如何为引用的 URI 找到匹配模式?

最佳答案

尝试使用 http://grokdebug.herokuapp.com/discover用于发现字符串的过滤器。此应用程序非常有用,尤其是在使用和测试长而动态的日志消息时。

enter image description here

也可以考虑使用 http://grokdebug.herokuapp.com/用一组其他字符串测试你的模式。

enter image description here

关于regex - 神交 - 如何获得 URIPATHPARAM?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21769151/

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