Simple Elasticsearch and Logstash Jdbc plugin is not working


(Pankaj) #1

I already installed Logtsash and Elasticsearch version 6.4 for both and I tried simple file and run it. No error comes but index is not creted.

input {
	jdbc	{
      
		jdbc_driver_library => "/opt/share/logstash/logstash-6.4.0/lib/ojdbc7-12.1.0.2.jar"
		jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
		jdbc_connection_string => "jdbc string"
		jdbc_user => "root"
		jdbc_password => "pank"
		schedule => "0 */2 * * *"
		use_column_value => true
        tracking_column => "UPD_DATETIME"
		tracking_column_type => "timestamp"
		statement => "SELECT *  FROM DB.user_details WHERE register_date >   To_date ('30/06/2008 00:00:00', 'DD/MM/YYYY HH24:MI:SS') AND UPD_DATETIME > :sql_last_value"
		type=>"user_details"
	}
	jdbc	{
     
		jdbc_driver_library => "/opt/share/logstash/logstash-6.4.0/lib/ojdbc7-12.1.0.2.jar"
		jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
		jdbc_connection_string => "jdbc string"
		jdbc_user => "root"
		jdbc_password => "pank"
		schedule => "0 */2 * * *"
		use_column_value => true
        tracking_column => "UPD_DATETIME"
		tracking_column_type => "timestamp"
		statement => "SELECT *  FROM DB.library_info WHERE EFFECTIVE_DATE >   To_date ('30/06/2008 00:00:00', 'DD/MM/YYYY HH24:MI:SS') AND UPD_DATETIME > :sql_last_value"
		type=>"library_info"
	}
 }

 
output {
if [type] == "std_al_pr_vw" {
        elasticsearch {
            hosts => "localhost:9200"
            index => "user_detail"
            document_id => "%{ID}"
        }
    }
    if [type] == "trailing_perf_vw" {
        elasticsearch {
            hosts => "localhost:9200"
            index => "library_info"
            document_id => "%{ID}"
        }
    }
}

(system) #2

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