Delete datas before insert

Hello !

I use logstash to save my CSV files in ElasticSearch.
I need to delete my old datas before each treatment.

Example :

  • a new CSV file is copied in my directory
  • logstash delete items in elasticsearch with a query => { "query": { "match": { "DATA":"test" } } }
  • logstash insert datas from CSV to elasticsearch

I can not use this solution because I need to delete ALL my datas with a query.

Can someone help me?

Thanks (sorry for my bad english ^^)

I don't think there is an clean way to do this with ES+LS, you may need to script something to delete data from ES and then call LS on the files.