2013-05-13 182 views
0

我有以下配置文件。但是,当我运行这个时,我得到在终端中更改的时间戳,但日志没有发送到ElasticSearch。Logstash日期过滤器不起作用

下面是配置文件:

input { 
stdin { 
    type => "stdin-type" 
    } 
} 
filter { 

    grok { 
    type => "stdin-type" 
    patterns_dir=>["./patterns"] 
    pattern => "%{PARSE_ERROR}" 
    add_tag=>"%{type1},%{type2},%{slave},ERR_SYSTEM" 
    } 


mutate 
{ 
    type=>"stdin-type" 
    replace => ["@message", "%{message}" ] 
replace =>["@timestamp","2013-05-09T05:19:16.876Z"] 

} 


} 
output { 
    stdout { debug => true debug_format => "json"} 
    elasticsearch 
{ 
} 
} 

在取出取代线,该日志被运出。我哪里错了?

回答

0

用详细标志运行logstash,然后检查你的logstash日志是否有输出。在详细模式下,logstash进程通常会确认邮件是否已发送给ES,或者为何不发送。

你的配置看起来很干净......如果详细标志不给你任何有意义的输出,那么你应该检查你的ES设置。

0

尝试在第二个mutate code block中替换第二个。

mutate 
{ 
    type=>"stdin-type" 
    replace => ["@message", "%{message}" ] 
} 
mutate 
{ 
    type=>"stdin-type" 
    replace =>["@timestamp","2013-05-09T05:19:16.876Z"] 

}