Delete documents after sync

I have a logstash config where I am putting data from one to another

input {
  elasticsearch {
    hosts => [ "http://localhost:9200" ]
    index => "node_2"
    docinfo => true
  }
}

output {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    index => "node_1"
    document_type => "fields"
    doc_as_upsert => true
    manage_template => false
    document_id => "%{[@metadata][_id]}"
  }
  stdout {
    codec => "dots"
  }
}

filter {
 mutate {
  remove_field => [ "@version","@timestamp" ]
 }
}

The above query is working fine but I just need to delete the documents form node_2 after the sync is done.

Is there a way to do it same configuration ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.