Repeating the Same Directive inside mutate

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.

:cross_mark: 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.”

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.