Logstash from command line works, but not from service?

So, I have a conf file for checking a mysql DB and adding new records. It works great when I run it via the terminal (bin/logstash -f <file.conf>) but when I move the .conf in the conf.d folder, it never runs.

I check the logs, it says the pipeline started, but never actually does any requests.
my config:
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://mydb.com/dbname"
jdbc_user => "user"
jdbc_password => "pwd"
jdbc_driver_library => "/root/mysql-connector-java-8.0.18/mysql-connector-java-8.0.18.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
# our query
statement => "SELECT * FROM table WHERE id > :sql_last_value"
use_column_value => true
tracking_column => id
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
schedule => "* * * * *"
}
}

output {
elasticsearch {
hosts => ["localhost:9200"]
index => "db-%{+yyyy-MM-dd}"
}
}

reporting back in case someone else runs into the same issue. Logstash as a service runs on its own user, which doesnt have access to root's folder. There was no permission denied messages either, so a bit trickier to debug. All resolved now.

1 Like

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