logstash-filter-mutate icon indicating copy to clipboard operation
logstash-filter-mutate copied to clipboard

Fix the merge function of the mutate filter

Open johnmschoonover opened this issue 2 years ago • 4 comments

The dest_field_value was derived before the added fields were iterated upon. This caused the subsequent event.set's, when iterating over multiple added_field_value's, to set the dest_field based on the initial dest_field_value.

The logic should, instead, update the dest_field_value on each iteration of added_field so that it may continue to add to the dest_field_value instead of always only adding the last item in the list.

Thanks for contributing to Logstash! If you haven't already signed our CLA, here's a handy link: https://www.elastic.co/contributor-agreement/

johnmschoonover avatar May 01 '23 14:05 johnmschoonover

💚 CLA has been signed

I have signed the contributor agreement

johnmschoonover avatar May 01 '23 15:05 johnmschoonover

I concluded the same and opened issue #167 and a PR including tests #168

TotalKnob avatar May 26 '23 14:05 TotalKnob

Awesome, thanks much!

Pls don't hesitate to LMK if further work/assistance is needed to get this resolved :)

johnmschoonover avatar May 26 '23 23:05 johnmschoonover