绝对可以按照您的建议去做,但是如果您使用的是Logstash
1.5,则需要使用该
transport协议,因为
delete通过HTTP协议进行操作时Logstash
1.5中存在一个错误(请参见问题#195)。
因此,如果您的
delete.csvCSV文件格式如下:
id123451234612347
您的
delete.confLogstash配置如下所示:
input { file { path => "/path/to/your/delete.csv" start_position => "beginning" sincedb_path => "/dev/null" }}filter { csv { columns => ["id"] }}output { elasticsearch{ action => "delete" host => "localhost" port => 9300 <--- make sure you have this protocol => "transport" <--- make sure you have this index => "your_index" <--- replace this document_type => "your_doc_type" <--- replace this document_id => "%{id}" }}然后,在运行时,
bin/logstash -f delete.conf您将能够删除其CSV文件中指定了ID的所有文档。



