# Repeating the Same Directive inside mutate

**URL:** <https://discuss.elastic.co/t/repeating-the-same-directive-inside-mutate/382385>\
**Category:** Logstash\
**Created:** [October 2, 2025, 11:26pm UTC](https://discuss.elastic.co/t/repeating-the-same-directive-inside-mutate/382385 "2025-10-02T23:26:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evan2](https://avatars.discourse-cdn.com/v4/letter/e/d07c76/32.png) [@Evan2](https://discuss.elastic.co/u/Evan2)\
**Post date:** [October 2, 2025, 11:26pm UTC](https://discuss.elastic.co/t/repeating-the-same-directive-inside-mutate/382385/1 "2025-10-02T23:26:32Z")

</div>

I’ve been given the below advice from our Copilot instance. Can you please confirm its authenticity? I have a few Logstash pipelines using multiple remove\_field directives and need to know if I should instead be using multiple mutate blocks. Thankyou.

”❌ Repeating the Same Directive

There is **no documentation** that explicitly states you cannot repeat `remove_field` multiple times. However, based on how Logstash parses configuration blocks, **only the last `remove_field` directive will be applied** , because each directive **overwrites** the previous one.

This behavior is consistent with how Logstash handles configuration keys: if you repeat the same key (`remove_field`) in the same block, the last one wins.”

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 3, 2025, 12:37am UTC](https://discuss.elastic.co/t/repeating-the-same-directive-inside-mutate/382385/2 "2025-10-03T00:37:57Z")

</div>

> [@Evan2](#):
>
> Can you please confirm its authenticity?

No, it is wrong. Some plugin options _will_ be overwritten if specified more than once, but remove\_field is an array, and tests show that array values are merged if the same option occurs more than once. I suspect it will merge repeated hash options too.
