# Performace: add\_field vs. replace

**URL:** <https://discuss.elastic.co/t/performace-add-field-vs-replace/64736>\
**Category:** Logstash\
**Created:** [November 2, 2016, 3:56pm UTC](https://discuss.elastic.co/t/performace-add-field-vs-replace/64736 "2016-11-02T15:56:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mostolog](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@mostolog](https://discuss.elastic.co/u/mostolog)\
**Post date:** [November 2, 2016, 3:56pm UTC](https://discuss.elastic.co/t/performace-add-field-vs-replace/64736/1 "2016-11-02T15:56:14Z")

</div>

Hi

I have a logstash chain: logstashA output is logstashB input, whose output is logstashC input...  
What it's better?

Setting target value like (on each logstash step):

```auto
mutate{
    add_field => { "[@metadata][_index]" => "myindexonstepB" }
}

```

or replacing the field:

```auto
mutate{
    replace => { "[index]" => "myindexonstepB" }
}

```

Thanks

---

<div class="post-metadata">

**Author:** ![talevy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talevy/32/44896_2.png) [@talevy](https://discuss.elastic.co/u/talevy)\
**Post date:** [November 2, 2016, 9:57pm UTC](https://discuss.elastic.co/t/performace-add-field-vs-replace/64736/2 "2016-11-02T21:57:27Z")

</div>

both should be fairly comparable. I wouldn't expect one or the other to significantly change the performance of your pipeline

---

<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:** [July 6, 2017, 4:31am UTC](https://discuss.elastic.co/t/performace-add-field-vs-replace/64736/3 "2017-07-06T04:31:26Z")

</div>


