JDBC input plugin
JDBC input plugin is there to fetch data from any database with the Logstash JDBC interface. It has a built-in scheduler that can be set to fetch the data at regular intervals without affecting the application that is connected with the database. We can also run a one-time query to fetch the data from a database.
Each column of a record converts into field, and each row converts as a resultset that can be inserted as a document in Elasticsearch. JDBC driver library is not shipped with this plugin, and we need to explicitly pass the path of the driver using the jdbc_driver_library
configuration of the plugin. We are going to discuss many features of JDBC input plugin here.
Scheduling
We can schedule the Logstash input through JDBC input plugin. There is a specific syntax using which we can set the schedule frequency. The syntax for JDBC input plugin is quite similar to cron
. Look at the following example:
"* * * * * " => runs every second "30 2 * * *" => runs as 2:30AM...