Hi,
I'm running Logstash version 8.10.2 in a Docker container to ingest data from a MySQL DB into Elastic.
I don't know why the first statement is executed but the second one does not execute.
Below is my logstash config:
input {
jdbc {
clean_run => true
jdbc_driver_library => "/usr/share/logstash/config/mysql-connector-j-8.1.0.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://10.10.10.1:3306/myDB"
jdbc_user => "username"
jdbc_password => "password"
schedule => "* * * * *"
statement => "select * from contacts where icn > :sql_last_value"
use_column_value => true
tracking_column => "icn"
type => "contacts"
last_run_metadata_path => "/usr/share/logstash/data/import-contacts.yml"
}
jdbc {
clean_run => true
jdbc_driver_library => "/usr/share/logstash/config/mysql-connector-j-8.1.0.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://10.10.10.1:3306/myDB"
jdbc_user => "username"
jdbc_password => "password"
schedule => "* * * * *"
statement => "select * from jobs where jobid > :sql_last_value"
use_column_value => true
tracking_column => "jobid"
type => "jobs"
last_run_metadata_path => "/usr/share/logstash/data/import-jobs.yml"
}
filter {
}
output {
stdout {
id => "all_output"
codec => rubydebug
}
elasticsearch {
hosts => ["https://10.1.10.26:9200"]
index => "z4_db"
user => "elastic"
password => "changeme"
ssl_verification_mode => "none"
}
}
Both import-contacts.yml
and import-jobs.yml
get created in the container, however, only the import-contacts.yml
file has the last value in it.