# JDBC Input plugin installation

**URL:** <https://discuss.elastic.co/t/jdbc-input-plugin-installation/288510>\
**Category:** Logstash\
**Created:** [November 5, 2021, 3:13pm UTC](https://discuss.elastic.co/t/jdbc-input-plugin-installation/288510 "2021-11-05T15:13:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SANDRA\_ROY\_ARICATT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandra_roy_aricatt/32/96765_2.png) [@SANDRA\_ROY\_ARICATT](https://discuss.elastic.co/u/SANDRA_ROY_ARICATT)\
**Post date:** [November 5, 2021, 3:13pm UTC](https://discuss.elastic.co/t/jdbc-input-plugin-installation/288510/1 "2021-11-05T15:13:52Z")

</div>

I have the new Mac M1 Silicon.  
I need to get data from MySQL workbench into Elasticsearch.  
I came to know that it can be achieved using Logstash, which in turn uses JDBC input plugin for getting data from database into Elasticsearch.  
I installed Logstash and Elasticsearch by downloading it from the website.  
I ran Elasticsearch first, I created Logstash .conf file for specifying input and output.

I have confusions regarding installation of JDBC input plugin and JDBC driver library.

db.conf file - Logstash

```auto
#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 => "password"
		#the path to our downloaded jdbc driver
		jdbc_driver_library => "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"

	}

}

output{
	#stdout { codec => json_lines }
	elasticsearch {
		#protocol => http
		index => "db"
		document_type => "Menu"
		document_id => "%{ID}"
		hosts => "http://127.0.0.1:9200"
		
	}
}

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 5, 2021, 7:00pm UTC](https://discuss.elastic.co/t/jdbc-input-plugin-installation/288510/2 "2021-11-05T19:00:06Z")

</div>

logstash-input-jdbc is bundled with the default logstash package, you do not need to install it.

jdbc\_driver\_library should include the full path to the jar file.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 3, 2021, 7:00pm UTC](https://discuss.elastic.co/t/jdbc-input-plugin-installation/288510/3 "2021-12-03T19:00:40Z")

</div>

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