# How to use jdbc input plugin for to migrate data from progresql to elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-to-use-jdbc-input-plugin-for-to-migrate-data-from-progresql-to-elasticsearch/65309>\
**Category:** Logstash\
**Created:** [November 8, 2016, 7:25am UTC](https://discuss.elastic.co/t/how-to-use-jdbc-input-plugin-for-to-migrate-data-from-progresql-to-elasticsearch/65309 "2016-11-08T07:25:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kartheek91](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kartheek91](https://discuss.elastic.co/u/kartheek91)\
**Post date:** [November 8, 2016, 7:25am UTC](https://discuss.elastic.co/t/how-to-use-jdbc-input-plugin-for-to-migrate-data-from-progresql-to-elasticsearch/65309/1 "2016-11-08T07:25:01Z")

</div>

I have Installed logstash 5.0 and I'm trying to get the data from progresql table to json lines.This is the error I'm getting please help.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/9/94e9dddd6e89a2788c648a95e9a68033d6d36650.png)

and the conf file is like this

# file: simple-out.conf

input {  
jdbc {  
# Postgres jdbc connection string to our database, mydb  
jdbc\_connection\_string =\> "jdbc:postgresql://localhost:5432/postgres"  
# The user we wish to execute our statement as  
jdbc\_user =\> "postgres"  
# The path to our downloaded jdbc driver  
jdbc\_driver\_library =\> "/home/kartheek/Desktop/postgresql-9.4.1212.jre6.jar"  
# The name of the driver class for Postgresql  
jdbc\_driver\_class =\> "org.postgresql.Driver"  
# our query  
statement =\> "SELECT \* from contacts"  
}  
}  
output {  
stdout { codec =\> json\_lines }  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 10, 2016, 6:38am UTC](https://discuss.elastic.co/t/how-to-use-jdbc-input-plugin-for-to-migrate-data-from-progresql-to-elasticsearch/65309/2 "2016-11-10T06:38:49Z")

</div>

Here's the documentation for the settings file: [https://www.elastic.co/guide/en/logstash/current/logstash-settings-file.html](https://www.elastic.co/guide/en/logstash/current/logstash-settings-file.html)

Either make sure there's such a file in one of the listed locations or use the `--path.settings` option to point Logstash to another location.

---

<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 8, 2016, 6:38am UTC](https://discuss.elastic.co/t/how-to-use-jdbc-input-plugin-for-to-migrate-data-from-progresql-to-elasticsearch/65309/3 "2016-12-08T06:38:53Z")

</div>

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