# Postgresql to Elastic Search

**URL:** <https://discuss.elastic.co/t/postgresql-to-elastic-search/341319>\
**Category:** Elasticsearch\
**Tags:** datastreams\
**Created:** [August 22, 2023, 5:15am UTC](https://discuss.elastic.co/t/postgresql-to-elastic-search/341319 "2023-08-22T05:15:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oreobiskuit](https://avatars.discourse-cdn.com/v4/letter/o/96bed5/32.png) [@oreobiskuit](https://discuss.elastic.co/u/oreobiskuit)\
**Post date:** [August 22, 2023, 5:15am UTC](https://discuss.elastic.co/t/postgresql-to-elastic-search/341319/1 "2023-08-22T05:15:20Z")

</div>

Hi everyone, I'm new to Elasticsearch.

Currently I'm trying to replicate my db from postgresql and transform it to Elasticsearch. I've tried using google datastream (since my db is deployed in cloudSql) to cloud storage, then using dataflow to ingest the output from datastream to Elasticsearch but I need to somehow transform the data from datastream output to csv or pubsub message since the template is only supported in csv / ingest from pubsub. I think it's possible by using cloud function but I feel like there will be too much process. I'm also looking at some psql extension like zombodb, but it's not fit with my need where I want to transform the data first before storing it to Elasticsearch.

Is there any suggestion or recommendation that I can look for ?

Thank you in advance 🙏

---

<div class="post-metadata">

**Author:** ![Samuele\_Lolli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuele_lolli/32/107848_2.png) [@Samuele\_Lolli](https://discuss.elastic.co/u/Samuele_Lolli)\
**Post date:** [August 23, 2023, 2:51pm UTC](https://discuss.elastic.co/t/postgresql-to-elastic-search/341319/2 "2023-08-23T14:51:44Z")

</div>

Hi,  
i have done something similar to what you need and maybe i can help you a little bit.  
You should try to ingest data into elastic from Logstash, you can use the Jdbc input plugin or the file plugin if you have CSV files.

Jdbc plugin - [Jdbc input plugin | Logstash Reference [8.9] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html)  
File plugin - [File input plugin | Logstash Reference [8.9] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html)

If you have more question just ask and i can help you a bit.

hope i was helpful

---

<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:** [September 20, 2023, 2:52pm UTC](https://discuss.elastic.co/t/postgresql-to-elastic-search/341319/3 "2023-09-20T14:52:02Z")

</div>

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