Delete documents from elastic search if not exist in input


(marwen ben alaya) #1

Hello friend,
I have an elasticsearch database and i want to delete all documents if not exists in input statement? Can you help me please,

Thanks in advance

    input {jdbc {
jdbc_validate_connection => true
jdbc_connection_string => "jdbc:postgresql://xxxx:xxxx/xxxx"
jdbc_user => "xxxx"
jdbc_password => "xxxx"
jdbc_driver_library => "/usr/share/logstash/Drivers/postgres/postgresql-9.4.1212.jar"
jdbc_driver_class => "org.postgresql.Driver"
statement => "SELECT acso.usagers.id as id FROM acso.usagers WHERE acso.usagers.date_suppression is null"
tags => ["idUsagers"]}}  filter {}output {  elasticsearch {
action => delete
index => "usagers"
document_type => "atms"
doc_as_upsert => true
document_id => "%{id}"
hosts => "xxxxxx.example.org"}}

(system) #3

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