Hi,
I run the logstash via command prompt :
logstash -f logstash.conf
input {
jdbc {
jdbc_driver_library => "C:\ELASTIC\sqljdbc_6.0\enu\jre8\sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://server;databaseName=database;"
jdbc_user => "user"
jdbc_password => "pwd"
statement => "select top 200 * from table"
}
}
filter {
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "oph2"
document_id => "%{id2}"
}
stdout { codec => rubydebug }
}
The logstash run well, since i saw the 200 row displayed in command prompt. But when I check in elasticsearch why only 1 row affected to elasticsearch, and the rest 199 were deleted, by checking in Kibana:
"stats": {
"primaries": {
"docs": {
"count": 1,
"deleted": 199
},
Is there anyone has the solution regarding this? Why the 199 rows were deleted?
Thanks in advance