# Duplicated data

**URL:** <https://discuss.elastic.co/t/duplicated-data/206606>\
**Category:** Logstash\
**Created:** [November 5, 2019, 12:23pm UTC](https://discuss.elastic.co/t/duplicated-data/206606 "2019-11-05T12:23:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AstroSlazak](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@AstroSlazak](https://discuss.elastic.co/u/AstroSlazak)\
**Post date:** [November 5, 2019, 12:23pm UTC](https://discuss.elastic.co/t/duplicated-data/206606/1 "2019-11-05T12:23:02Z")

</div>

Hi,  
I am using jdbc to grab data from SQL, and it works, kind of.  
I have default index XXXXXX but from database i want to create a new index.

```
output {
 if [type] == "stops" or [type] == "signon" {
   elasticsearch {
  hosts => ["http://elasticsearch:9200"]
    ilm_rollover_alias => "WWWW"
 }
}
else{
elasticsearch {
hosts => ["http://elasticsearch:9200"]
ilm_rollover_alias => "ZZZZ"
}
}
stdout { codec => rubydebug }	
}

```

In kibana i see that i have index WWWW and ZZZZ, but the same data i get in my default index XXXX, how to do to get data only to WWWW and ZZZZ ?

---

<div class="post-metadata">

**Author:** ![AstroSlazak](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@AstroSlazak](https://discuss.elastic.co/u/AstroSlazak)\
**Post date:** [November 6, 2019, 1:37pm UTC](https://discuss.elastic.co/t/duplicated-data/206606/2 "2019-11-06T13:37:01Z")

</div>

I solve it, i found that elasticsearch **MERGE** config file, due to my conditions (if and else) did not work correctly. After I changed my conditions everything work fine.

---

<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, 1:37pm UTC](https://discuss.elastic.co/t/duplicated-data/206606/3 "2019-12-04T13:37:03Z")

</div>

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