Not working JDBC Mysql in UBUNTU 16 --- Homestead VAGRANT MACHINE

Hello !

Ive been trying to migrate the data from a mysql database into elasticsearch using LOGSTASH But not working.
Both Elasticsearch and kibana are running and i created the logstash config file in /etc/logstash/conf.d

With the following settings :

echo "input {
jdbc {
jdbc_driver_library => "/etc/logstash/mysql-connector-java-5.1.43"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/homestead"
jdbc_user => "homestead"
jdbc_password => "secret"

statement => "SELECT name FROM users"

}
}
output {
elasticsearch {
action => "index"
hosts => ["your_host"]
index => "your_index"
document_type => "your_type"
}
}
" >> /etc/logstash/conf.d/mystash.conf

Whenever i try to run the the command from /usr/share/logstash/bin as : logstash -f mystash.conf

Getting error : -bash: logstash: command not found

Anyone has an idea how to do this ?

PLease help ! Its frustrating af.

Apparently /usr/share/logstash/bin isn't in your path so you have to either

  • add it to your path,
  • invoke Logstash via ./logstash, or
  • invoke Logstash via /usr/share/logstash/bin.

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