Delete documents loaded in the index in elastic via logstash

I am using the following configuration file, but it does not delete the CUITS numbers that I get from my SQL database in the elasticsearch index.

This is the code in the file

input {
jdbc {
jdbc_connection_string => "jdbc:sqlserver://;databaseName=DW"
jdbc_user => "user"
jdbc_password => "password"
jdbc_validate_connection => true
jdbc_driver_library => "/home/ec2-user/logstash-6.5.4/driverJDBC/sqljdbc42.jar"
jdbc_driver_class => ""
statement => "SELECT * from DELETE_ELASTIC"
output {
amazon_es {
hosts => [""]
region => "us-east-1"
aws_access_key_id => 'Acceskey'
aws_secret_access_key => 'secretkey'
action => "delete"
index => "enriquecimiento"
document_type => "personas"
document_id => "%{cuitnumero}"

I have not used the jdbc driver input module, but if you want to remove data you should be using a filter{} block with mutate remove_field or similar to do it.

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