# Logstash clone filter overwriting user data

**URL:** https://discuss.elastic.co/t/logstash-clone-filter-overwriting-user-data/105863
**Category:** Logstash
**Created:** [October 31, 2017, 10:01am UTC](https://discuss.elastic.co/t/logstash-clone-filter-overwriting-user-data/105863 "2017-10-31T10:01:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Dan\_Markhasin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dan_markhasin/32/14187_2.png) [@Dan\_Markhasin](https://discuss.elastic.co/u/Dan_Markhasin)
#### Post date: [October 31, 2017, 10:01am UTC](https://discuss.elastic.co/t/logstash-clone-filter-overwriting-user-data/105863/1 "2017-10-31T10:01:33Z")

</div>

There is (IMO) a critical bug in the clone filter:

> <https://github.com/logstash-plugins/logstash-filter-clone/issues/8>

Since it is hard-coded to do:  
clone.set("type", type)

It will overwrite whatever was in the original "type" field in the document, causing data corruption/loss.

I've submitted a pull request ([https://github.com/logstash-plugins/logstash-filter-clone/pull/12](https://github.com/logstash-plugins/logstash-filter-clone/pull/12)) but doesn't look like anyone has looked into it yet. Can it please be merged / the bug fixed in any other way?

---

<div class="post-metadata">

### Author: ![Dan\_Markhasin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dan_markhasin/32/14187_2.png) [@Dan\_Markhasin](https://discuss.elastic.co/u/Dan_Markhasin)
#### Post date: [November 6, 2017, 4:45pm UTC](https://discuss.elastic.co/t/logstash-clone-filter-overwriting-user-data/105863/2 "2017-11-06T16:45:51Z")

</div>

Quite disappointing that nobody has bothered to reply, either here or on the GitHub issue. Especially given the potential impact of this bug and the fix that was already provided.

This really leaves me no choice except forking the filter and maintaining my own version of it.

---

<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, 2017, 4:46pm UTC](https://discuss.elastic.co/t/logstash-clone-filter-overwriting-user-data/105863/3 "2017-12-04T16:46:38Z")

</div>

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