# Connecting to Postgresql from elasticsearch

**URL:** <https://discuss.elastic.co/t/connecting-to-postgresql-from-elasticsearch/123873>\
**Category:** Elasticsearch\
**Created:** [March 14, 2018, 9:54am UTC](https://discuss.elastic.co/t/connecting-to-postgresql-from-elasticsearch/123873 "2018-03-14T09:54:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nandhini\_murugesan](https://avatars.discourse-cdn.com/v4/letter/n/dec6dc/32.png) [@Nandhini\_murugesan](https://discuss.elastic.co/u/Nandhini_murugesan)\
**Post date:** [March 14, 2018, 9:54am UTC](https://discuss.elastic.co/t/connecting-to-postgresql-from-elasticsearch/123873/1 "2018-03-14T09:54:55Z")

</div>

I'm new to elastic search..I need to know whether I can send data from database(Postgresql) to elastic search directly without using logstash and beats.if there any way..pls suggest me..thanks in advance.

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [March 14, 2018, 9:57am UTC](https://discuss.elastic.co/t/connecting-to-postgresql-from-elasticsearch/123873/2 "2018-03-14T09:57:10Z")

</div>

There is no direct way, you need a process that will pull data from postgres and put it into Elasticsearch.

---

<div class="post-metadata">

**Author:** ![Nandhini\_murugesan](https://avatars.discourse-cdn.com/v4/letter/n/dec6dc/32.png) [@Nandhini\_murugesan](https://discuss.elastic.co/u/Nandhini_murugesan)\
**Post date:** [March 14, 2018, 10:20am UTC](https://discuss.elastic.co/t/connecting-to-postgresql-from-elasticsearch/123873/3 "2018-03-14T10:20:40Z")

</div>

Can you suggest some way to send data to elastic search from postgres

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [March 14, 2018, 10:42am UTC](https://discuss.elastic.co/t/connecting-to-postgresql-from-elasticsearch/123873/4 "2018-03-14T10:42:47Z")

</div>

I'm not a logstash expert (please ask on the logstash forums if you need more info) but Logstash has a JDBC input plugin ([https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html)) and an Elasticsearch output plugin ([https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html)) so this should do the work. Alternatively this should also be relatively easy to write with your favourite programming language.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 14, 2018, 11:00am UTC](https://discuss.elastic.co/t/connecting-to-postgresql-from-elasticsearch/123873/5 "2018-03-14T11:00:40Z")

</div>

I shared my thoughts in [http://david.pilato.fr/blog/2015/05/09/advanced-search-for-your-legacy-application/](http://david.pilato.fr/blog/2015/05/09/advanced-search-for-your-legacy-application/)

---

<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:** [April 11, 2018, 11:00am UTC](https://discuss.elastic.co/t/connecting-to-postgresql-from-elasticsearch/123873/6 "2018-04-11T11:00:44Z")

</div>

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