input {
jdbc {
jdbc_driver_library => "sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://localhost:1433;databaseName=transactions_sample_db"
jdbc_user => "sa"
jdbc_password => "awesome"
statement => "SELECT * from sample"
# schedule => "* * * * *"
}
}
output {
stdout { codec => json_lines }
elasticsearch {
hosts => ["localhost:9200"]
index => "test_index_4"
document_id => "%{[_id]}"
}
}
the above code describes my config file,
and am doing all configurations and everything on my windows laptop (4gb ram) , am new to logstash.
The Problem is:
- If i run logstash to create a new index that id not in elasticsearch without document_id in conf file it works fine, but if i create a new index with document_id it hangs forever, here are all files i have in logstash attached
- The document_id works fine if index is already present, then it avoids duplicates.
- Do i have to change my config file when am creating index for first time, and then add document it later? as _id is not present for first time?
(my elastic search is always running and also i can see indexes on http://localhost:9200/_cat/indices?v)