Open joschi99 opened 8 years ago
The jdbc import is starting every minute. The last row from the previous import is imported with the new import again. This means that on every import job we have 1 double row.
jdbc { jdbc_validate_connection => true jdbc_connection_string => "jdbc:mysql://localhost:3306/centreon_storage" jdbc_user => "backup" jdbc_password => "mFRiQYIuwHhCIk6s753Q" jdbc_driver_library => "/etc/logstash/jdbc/mysql-connector-java-5.1.39-bin.jar" jdbc_driver_class => "com.mysql.jdbc.Driver" statement_filepath => "/etc/logstash/sql/centreon-service-status.sql" last_run_metadata_path => "/tmp/logstash-centreon-service-status.lastrun" record_last_run => true use_column_value => true tracking_column => "last_check" schedule => "* * * * *" tags => [ "jdbc", "centreon", "mariadb", "service" ] type => "centreon-service-status" }
In the SQL we use the function sql_last_value
SELECT * FROM services AS s, hosts AS h WHERE s.host_id = h.host_id AND s.enabled = 1 AND h.enabled = 1 AND s.last_check > :sql_last_value
opend a case https://github.com/logstash-plugins/logstash-input-jdbc/issues/178
The jdbc import is starting every minute. The last row from the previous import is imported with the new import again. This means that on every import job we have 1 double row.
In the SQL we use the function sql_last_value