我正在尝试解析此日志行: - 2014-04-29 13:04:23,733 [main] INFO (api.batch.ThreadPoolWorker) 此运行的命令行选项: 这是我使用的 logstash 配置文件:
input {
stdin {}
}
filter {
grok {
match => [ "message", " - %{TIMESTAMP_ISO8601:time} \[%{WORD:main}\] %{LOGLEVEL:loglevel} %{JAVACLASS:class} %{DATA:mydata} "]
}
date {
match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
}
output {
elasticsearch {
host => "localhost"
}
stdout { codec => rubydebug }
}
{
"message" => " - 2014-04-29 13:04:23,733 [main] INFO (api.batch.ThreadPoolWorker) Commans run:",
"@version" => "1",
"@timestamp" => "2015-02-02T10:53:58.282Z",
"host" => "NAME_001.corp.com",
"tags" => [
[0] "_grokparsefailure"
]
}
请如果有人可以帮助我找到 gork 模式的问题所在。我试图在http://grokdebug.herokuapp.com/中解析该行,但它仅解析时间戳、%{WORD} 和 %{LOGLEVEL} 其余部分被忽略!