Mutate#replace should set new field even if new field doesn't exist

Description

A previous commit (https://github.com/logstash/logstash/commit/75c0c9a1b58840b65f7cb5322e728322df50a7a2) did it so you could replace to a field that didn't exist previously, but an unrelated commit (https://github.com/logstash/logstash/commit/17e1d38a12fa331c4b11e9dcf0e9f8cd53594763) seemed to have reverted this.

I stumbled upon it while using the pipe input that doesn't set @source_host, yet a filter of mine expected to be able to mutate another field to @source_host.

Environment

None

Status

Assignee

Jordan Sissel

Reporter

Andri Möll

Labels

None

Fix versions

Affects versions

Priority

Configure