2013-05-13 100 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"] 

}