【发布时间】:2014-10-03 12:35:30
【问题描述】:
新手提醒!
我有以下 grok 过滤器:
filter {
grok {
match => [ "message","%{DATESTAMP:timestamp}" ]
match => [ "message", "(?<number_after_timestamp>[0-9]{8}\s\w+)"]
match => [ "message", "(?<error_or_debug>(ERROR|DEBUG))"]
match => [ "message", "(?<first_part>ORB\.thread\.pool.*(?=\s{2}))" ]
match => [ "message", "(?<exception_class_name>(?<=\<Exception class name\=\s).*?\>)" ]
match => [ "message", "(?<exception_message>(?<=\<Exception message\=).*?(?=\>))" ]
}
}
在使用 grok 调试器进行测试时,这些模式中的每一个都与我需要的文本块完全匹配。在 grok 调试器中,命名模式名称用作字段并发出就好了。但是,当我在 grok 调试器中使用的相同日志事件上运行它时,不会发出来自日志事件行或字段名称的数据。
例如异常类名模式产生:
{
"exception_class_name": [
[
"com.ultatica.bd.exceptions.TTFException>"
]
]
}
但是当从 logstash 命令行运行数据时 -> 不是香肠!
非常感谢任何帮助。
谢谢
日志文件是这样的:
[30/09/14 23:07:15:195 BST] 00000043 SystemOut O ERROR 32109 Tue Sep 30 23:07:15 BST 2014 ORB.thread.pool : 2 webuser com.ultra.bd.services.UltraticoCustomerService.processRequest API getPerson <Exception class name= com.Ultratico.bd.exceptions.UCOException> <Exception message= e05CX432182S> <UCOException Error = 32109>
[30/09/14 23:07:15:200 BST] 00000043 SystemOut O ERROR 32109 Tue Sep 30 23:07:15 BST 2014 ORB.thread.pool : 2 webuser com.Ultratico.ecrm.framework.sessionHandler.UltraticoSessionHandler.execute <Exception class name= com.Ultratico.bd.exceptions.UCOException> <Exception message= e05CX432182S> <UCOException Error = 32109>
【问题讨论】:
-
你能从输入(日志文件等)中添加几行吗?
-
OP 已编辑以显示示例日志行
-
我发现 gro 调试器在我无法确定我的 grok 过滤器为什么不起作用的情况下非常有用:grokdebug.herokuapp.com
标签: logstash