Datadog Regex解析器规则未应用于日志
我已经在Grok Parser中写了一条正则规则,以解析日志URL路径。虽然它说这些模式在示例部分中匹配,但是在检查实时尾巴时,我看不到规则得到正确应用。请为此提供帮助。
使用的正则是:parseurl%{regex(“^([\/] [\ w \ d \ - \/] ([az] [\ w \ d \ \ - ] [^\ w \ d \ \ - \。 ]))| [\/]”):http.url_details.patternx}。
示例日志模式:输入: /abcd /efgh?13224预期: /abcd /efgh
ps:iam新手
I have written a regex rule in Grok parser to parse the log url paths. While it says the patterns matches in the sample section, but when checking the live tail i couldn't see the rules getting applied correctly. Please can you help on this.
regex used: parseurl %{regex("^([\/][\w\d\-\/]([a-z][\w\d\-][^\w\d\-\.]))|[\/]"):http.url_details.patternx}.
Sample log patterns: Input: /abcd/efgh?13224 Expected: /abcd/efgh
PS: Iam new to Datadog
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的示例是JavaScript Regex。有很多正则。 Grok Regex具有特定的语法;它与任意的正则发动机无法使用。
您需要使用Grok语法而不是JS或PCRE等。此工具可以帮助您构建和测试表达式。 https://grokconstructor.appspot.com/
Your example is JavaScript regex. There are many kinds of regex. Grok regex has a specific syntax; it won't work with arbitrary regex engines.
You need to use Grok syntax rather than JS or PCRE etc. This tool can help you build and test your expressions. https://grokconstructor.appspot.com/