Does not return data from the database

I can't get Elastic to return the data received from my DB, no data is returned, below is the configuration file:

input {

jdbc {

 jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver" 

 jdbc_connection_string => "jdbc:sqlserver://ELASTICSERVER\SQLEXPRESS:1433;databasename=Super_Loja_Elastic;integratedSecurity=false;" 

 jdbc_driver_library => "" 

 jdbc_paging_enabled => true

 tracking_column => "unix_ts_in_secs"

 use_column_value => true

 tracking_column_type => "numeric"

 schedule => "*/5 * * * * *"

 jdbc_user => "USER" 

 jdbc_password => "PASSWORD" 

 statement =>"SELECT *,DATEDIFF (SECOND, '1970-01-01', modification_time) AS unix_ts_in_secs  FROM superloja WHERE DATEDIFF (SECOND, '1970-01-01',modification_time) > :sql_last_value  AND :sql_last_value  <  DATEDIFF (SECOND, '1970-01-01',CURRENT_TIMESTAMP)"

}

}

output {

elasticsearch {

hosts => ["localhost:9200"]

index => "PRINCIPAL_Super_Loja" 

}

}

Hi @FernandoMOTA

  1. Do not forget to use the Preformatted text when sharing configuration details or logs messages.

  1. I see that you did not specify any value in the jdbc_driver_library setting. Did you place the corresponding JAR file in the Logstash Java classpath?

  2. Have you tried to run this SQL statement directly against your DB and check if it returns any results? (replacing sql_last_value with a test value).

  3. You could try to run Logstash with debug logging enabled to check for potential errors. For example, from the command line:

  • bin/logstash --debug -f mypipeline.conf

Feel free to share these debug logs with us (scrub any sensitive data).

Thank you.

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