# Logstash sync mysql data to es: can't aggregation two tables' fields with id

**URL:** <https://discuss.elastic.co/t/logstash-sync-mysql-data-to-es-cant-aggregation-two-tables-fields-with-id/156985>\
**Category:** Logstash\
**Created:** [November 16, 2018, 6:48am UTC](https://discuss.elastic.co/t/logstash-sync-mysql-data-to-es-cant-aggregation-two-tables-fields-with-id/156985 "2018-11-16T06:48:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SHocker-Yu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shocker-yu/32/37720_2.png) [@SHocker-Yu](https://discuss.elastic.co/u/SHocker-Yu)\
**Post date:** [November 16, 2018, 6:48am UTC](https://discuss.elastic.co/t/logstash-sync-mysql-data-to-es-cant-aggregation-two-tables-fields-with-id/156985/1 "2018-11-16T06:48:16Z")

</div>

> ELK version: 5.6.3.

I'm using logstash-jdbc-input plugin to sync two tables data from MySQL to elasticsearch with same index and same type, the conf file is like this:  
[![logstash.conf](https://us1.discourse-cdn.com/elastic/original/3X/2/0/207ca06ff553432d1c022de828374c074302dcae.png)](https://i.stack.imgur.com/4377w.png)

The table `d_product_set` and `d_product_tag` have the same filed `productid`.

The result I want is in these two tables fill aggregation with the `productid`.

But in fact, one table's data always cover another table's data, one doc's fields in `es` only same with one of table's fields.

Can someone point what's wrong in my code?

---

<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 14, 2018, 6:48am UTC](https://discuss.elastic.co/t/logstash-sync-mysql-data-to-es-cant-aggregation-two-tables-fields-with-id/156985/2 "2018-12-14T06:48:16Z")

</div>

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