# Load multiple tables data from oltp to elasticsearch using logstash

**URL:** <https://discuss.elastic.co/t/load-multiple-tables-data-from-oltp-to-elasticsearch-using-logstash/292886>\
**Category:** Logstash\
**Created:** [December 24, 2021, 11:17am UTC](https://discuss.elastic.co/t/load-multiple-tables-data-from-oltp-to-elasticsearch-using-logstash/292886 "2021-12-24T11:17:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![umang\_t](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/umang_t/32/99513_2.png) [@umang\_t](https://discuss.elastic.co/u/umang_t)\
**Post date:** [December 24, 2021, 11:17am UTC](https://discuss.elastic.co/t/load-multiple-tables-data-from-oltp-to-elasticsearch-using-logstash/292886/1 "2021-12-24T11:17:19Z")

</div>

What is the efficient way to load data from multiple tables (e.g. 10 to 15 tables from RDBMS) in to Elasticsearch . Note the RDBMS has records in millions so idea is to flatten the resultset and load in Elasticsearch .

Having statement in input configuration of logstash does not an efficient option as joining 10 to 15 tables in one go would not be a great idea . Alos some entities share One to Many relations ships.

E.g. Joining songs INNER JOIN song\_folder for more tables would cause further performance bottlenck on source database.

```auto
jdbc {
jdbc_driver_library => "mysql-connector-java-5.1.36-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/mydb"
jdbc_user => "mysql"
parameters => { "favorite_artist" => "Beethoven" }
schedule => "* * * * *"
statement => "SELECT * FROM songs INNER JOIN song_folder using song_number;"
}
}
type or paste code here

```

---

<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:** [January 21, 2022, 11:17am UTC](https://discuss.elastic.co/t/load-multiple-tables-data-from-oltp-to-elasticsearch-using-logstash/292886/2 "2022-01-21T11:17:35Z")

</div>

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