# Logstash: import tables depending on colum name value

**URL:** <https://discuss.elastic.co/t/logstash-import-tables-depending-on-colum-name-value/206826>\
**Category:** Logstash\
**Created:** [November 6, 2019, 3:48pm UTC](https://discuss.elastic.co/t/logstash-import-tables-depending-on-colum-name-value/206826 "2019-11-06T15:48:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asma\_Sassi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asma_sassi/32/47196_2.png) [@Asma\_Sassi](https://discuss.elastic.co/u/Asma_Sassi)\
**Post date:** [November 6, 2019, 3:48pm UTC](https://discuss.elastic.co/t/logstash-import-tables-depending-on-colum-name-value/206826/1 "2019-11-06T15:48:45Z")

</div>

I'm actually working on migrating mysql data to elasticsearch and had successfully imported tables to ES. And now I have another task which is more complicated, I have table A structure and its data like schema below:

![table%20A](https://us1.discourse-cdn.com/elastic/original/3X/8/c/8cb4ea7cf0c91fd43451345ff2b0e2edae48cdd1.png) ![data](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0ad5dafd5dc434080237b884663bc99fe9c1dbed.png)

Each file\_name has its own table in database:

![data_tables](https://us1.discourse-cdn.com/elastic/original/3X/0/f/0fb85920f123889cc0decbfdc87bf2409e8f6b55.png)

The table A is already imported to ES using logstash file. My question now is how to import those file tables depending on Table A by looping and running sql statement on each file\_name column value in logstash. Suggestions?

---

<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 4, 2019, 3:48pm UTC](https://discuss.elastic.co/t/logstash-import-tables-depending-on-colum-name-value/206826/2 "2019-12-04T15:48:49Z")

</div>

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