我試圖使用couchdb_changes Logstash插件來檢測我的CouchDB更改並充分更新Elasticsearch索引。Logstash couchdb_changes沒有正確地將文檔刪除傳播到Elasticsearch
文檔創作/更新工作正常,但不知何故刪除不起作用。
這裏是我的Logstash配置:
input {
couchdb_changes {
host => "localhost"
db => "products"
sequence_path => ".couchdb_products_seq"
type => "product"
tags => ["product"]
keep_revision => true
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "products"
# Pass the CouchDB document ID to Elastic, otherwise it is lost and Elastic generates a new one
document_id => "%{[@metadata][_id]}"
}
# Debug
stdout {
codec => rubydebug {
metadata => true
}
}
}
我碰到this link但「協議」參數中elasticsearch Logstash插件不再存在,我希望這樣一個巨大的錯誤到現在是固定的。
在我Logstash控制檯我看到這個的時候我刪除一個CouchDB文檔(從被褥):
{
"@version" => "1",
"@timestamp" => "2016-05-13T14:06:55.734Z",
"type" => "product",
"tags" => [
[0] "product"
],
"@metadata" => {
"_id" => "15d6f519d6827a2f28de4df1d40082d5",
"action" => "delete",
"seq" => 10020
}
}
因此,而不是刪除文件ID爲「15d6f519d6827a2f28de4df1d40082d5」,它替換其內容。這裏是文檔「15d6f519d6827a2f28de4df1d40082d5」刪除後,在Elasticsearch:
curl -XGET 'localhost:9200/products/product/15d6f519d6827a2f28de4df1d40082d5?pretty'
{
"_index" : "products",
"_type" : "product",
"_id" : "15d6f519d6827a2f28de4df1d40082d5",
"_version" : 3,
"found" : true,
"_source" : {
"@version" : "1",
"@timestamp" : "2016-05-13T14:06:55.734Z",
"type" : "product",
"tags" : [ "product" ]
}
}
爲什麼刪除不工作任何想法?這是couchdb_changes插件的錯誤嗎? elasticsearch插件?
的信息,這裏有我的應用程序版本: Elasticsearch 2.3.2 Logstash 2.3.2 的Apache CouchDB的1.6.1