Hi
I am working on Elastic Search using logstash conf file using sql query. I am connecting Sql Database using Logstash conf File. This is my Conf file
input {
jdbc {
jdbc_driver_library => "D:\Elastic\elasticsearch-6.0.0\lib\sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://192.168.0.168;databaseName=Sample;"
jdbc_user => "sa"
jdbc_password => "1234"
statement => "select Top 100 id,FName,LName,Email from dbo.AddUser WHERE id > :sql_last_value"
schedule => "* * * * *"
use_column_value => true
tracking_column => "id"
tracking_column_type => "numeric"
clean_run => true
}
}
output {
elasticsearch {
hosts => "localhost:9200"
index => "users"
document_id => "%{id}"
document_type => "user"
manage_template => true
}
stdout { codec => rubydebug }
}
My Table Column Details
<id, int>
<FName, varchar(200),>
,<LName, varchar(80),>
,<Email, varchar(80),>
,<Password, varchar(50),>
,<CreatedDate, datetime,>
,<LastUpdatedDate, datetime,>
,<Status, int,>
,<Resid, int,>
,<Budget, int,>
,<Dailsales, int,>
,<Reports, int,>
,<DayProfit, int,>
,<View, varchar(20),>
,<Boss, int,>
,<usersfrom, varchar(50),>)
When run this using logstash -f JDBCConnector.conf --debug .. it fetches all the records correctly.
When i Insert new record into Database, it fetches the new record correctly due to Schedule command in Conf File.
If i Update any records in Database , its not reflecting in my elastic search Output.
What mistake i did here?? I am new to elastic search and Logstash.
Please help...