I want to use Logstash to get the current count of all sessions on my MySQL DB every second.
Thats my configuration for the pipeline:
input {
jdbc {
jdbc_driver_library => "/usr/share/java/mysql-connector-java-5.1.45.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/sys?serverTimezone=UTC"
jdbc_user => "user"
jdbc_password => "password"
schedule => "* * * * *"
statement => "SELECT COUNT(*) AS count_sessions FROM sys.session"
}
}
output {
elasticsearch {
hosts => ["localhost:19200"]
index => "mysql-session-count-live-%{+YYYY.MM.dd}"
}
}
if I run this config I´m getting no error, but Logstash can´t execute the query and can´t be closed via systemctl stop logstash.service anymore. It says: blocked on starting worker...
Any Ideas why this happens?