Hi Guy
I am using the JDBC plugin and connect to mysql database and I have multiple data table.
The name of table is a number.When I run the logstash config have an error Syntax message:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1' at line 1: SELECT * FROM 1
This is my pipeline:
input {
jdbc {
jdbc_driver_library => "C:\Users\nitikarnh\Downloads\logstash-7.6.1\bin\mysql-connector-java-8.0.19.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/temperature"
jdbc_user => "infa"
jdbc_password => "infa"
schedule => "*/5 * * * * *"
statement => "SELECT * FROM 1"
type => "sensor_1"
}
}
input {
jdbc {
jdbc_driver_library => "C:\Users\nitikarnh\Downloads\logstash-7.6.1\bin\mysql-connector-java-8.0.19.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/temperature"
jdbc_user => "infa"
jdbc_password => "infa"
schedule => "*/5 * * * * *"
statement => "SELECT * FROM 2"
type => "sensor_2"
}
}
output {
elasticsearch {
hosts => "http://localhost:5601/"
index => "sensor"
document_type => "%{type}"
}
stdout { codec => rubydebug { metadata => true } }
#stdout { codec => "rubydebug"}
}