Elasticsearch schedule not working

Even when I provided the schedule option, logstash is getting records from MySQL every second. I wanted logstash to poll MySQL only in every 30 minutes.

logstash db.conf file

#file : db.conf
input{

jdbc {

	#connection string to database db
	jdbc_connection_string => "jdbc:mysql://localhost:3306/db"
	#user we wish to execute our statement as
	jdbc_user => "root"
	#user pw
	jdbc_password => "*"
	schedule => "0 0/30 * * * ?"
	#the path to our downloaded jdbc driver
	#jdbc_driver_library => "logstash-core/lib/jars/mysql-connector-java-8.0.27/mysql-connector-java-8.0.27.jar"
	#the name of the driver class for mysql
	#jdbc_driver_class => "com.mysql.jdbc.Driver"
	#query
	statement => "SELECT * from Menu"


}

I would appreciate for any suggestions.

Edit: I was editing a db.conf file which was in a different location. It works fine now

I think it should be something like this:

schedule => "*/30 * * * *"
1 Like

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