While executing the configuration file, logstash adding one additional row with the Query result. The additional row contains the "document_id" details. I am using "document_id" to prevent duplication of data for every run. The duplication issue solved, but one additional row is added to the result.
My configuration file is
input {
jdbc {
jdbc_driver_library => "C:/New_ELK/logstash-5.5.2/mysql-connector-java-5.1.42/mysql-connector-java-5.1.42-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/abc"
jdbc_user => "root"
jdbc_password => ""
schedule =>"* * * * *"
statement => "select user.id as user_id, concat(user.first_name,' ',user.last_name) as username from user
}
}
output {
elasticsearch {
index => "total_users"
hosts => ["localhost:9200"]
document_id => "%{[user_id]}"
}
stdout { codec => json_lines }
}
how to prevent adding "document_id" details into query result?