# Installing logstash jdbc plugin

**URL:** https://discuss.elastic.co/t/installing-logstash-jdbc-plugin/127885
**Category:** Logstash
**Created:** [April 13, 2018, 12:12am UTC](https://discuss.elastic.co/t/installing-logstash-jdbc-plugin/127885 "2018-04-13T00:12:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![squanchydata](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@squanchydata](https://discuss.elastic.co/u/squanchydata)
#### Post date: [April 13, 2018, 12:12am UTC](https://discuss.elastic.co/t/installing-logstash-jdbc-plugin/127885/1 "2018-04-13T00:12:09Z")

</div>

In order for me to link my mysql database with elasticsearch, I need the jdbc plugin with logstash.  
Where/how do I install this plugin and how do I use it?

---

<div class="post-metadata">

### Author: ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)
#### Post date: [April 13, 2018, 12:24am UTC](https://discuss.elastic.co/t/installing-logstash-jdbc-plugin/127885/2 "2018-04-13T00:24:36Z")

</div>

The JDBC input plugin is installed by default with modern versions of Logstash, but you may need to install a _driver_.

To do so, download the appropriate JDBC driver to the local filesystem of your Logstash host, and point to it in your pipeline configuration:

The MySQL driver is available for download [here](https://dev.mysql.com/downloads/connector/j/5.1.html).

Once it is on the Logstash machine's filesystem, you can reference it with the JDBC Input Plugin's [`jdbc_driver_library`](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#plugins-inputs-jdbc-jdbc_driver_library) and [`jdbc_driver_class`](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#plugins-inputs-jdbc-jdbc_driver_class) directives:

```auto
input {
  jdbc {
    "jdbc_driver_library" => "/path/to/mysql/driver.jar"
    "jdbc_driver_class" => "com.mysql.jdbc.Driver"
  }
}

```

---

<div class="post-metadata">

### Author: ![squanchydata](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@squanchydata](https://discuss.elastic.co/u/squanchydata)
#### Post date: [April 13, 2018, 12:37am UTC](https://discuss.elastic.co/t/installing-logstash-jdbc-plugin/127885/3 "2018-04-13T00:37:40Z")

</div>

Thank you. And the jdbc connection string should be pointing toward my localhost of mysql?

---

<div class="post-metadata">

### Author: ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)
#### Post date: [April 13, 2018, 1:44am UTC](https://discuss.elastic.co/t/installing-logstash-jdbc-plugin/127885/4 "2018-04-13T01:44:09Z")

</div>

If your mysql is hosted on the same machine, and is bound to local interfaces, then yes.

If your machine is hosted on a different machine, the connection string will need to reference it.

I found the MySQL docs for it here: [https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-jdbc-url-format.html](https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-jdbc-url-format.html)

---

<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: [May 11, 2018, 1:44am UTC](https://discuss.elastic.co/t/installing-logstash-jdbc-plugin/127885/5 "2018-05-11T01:44:22Z")

</div>

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