| eval tmp_{source_field} = replace({source_field}, /{regex}/, "##SEP##\\1##VAL_SEP##\\2##SEP##")
| eval tmp_{source_field} = filter(split(tmp_{source_field}, "##SEP##"), $row -> match($row, /.*##VAL_SEP##.*/ ))
| eval tmp_{source_field} = map(tmp_{source_field}, $row -> split($row, "##VAL_SEP##" ))
| eval tmp_{source_field} = reduce(tmp_{source_field}, json_object(), ($acc, $row)-> if(isnull(json_extract($acc, replace(trim($row[0]), /\s/, "_"))), json_set($acc, replace(trim($row[0]), /\s/, "_"),trim($row[1], "\r\n ")), json_set($acc, replace(trim($row[0]), /\s/, "_"), if(isarray(json_extract($acc, replace(trim($row[0]), /\s/,"_"))), json_append(json_extract($acc, replace(trim($row[0]), /\s/,"_")), "",trim($row[1], "\r\n ")), json_array(json_extract($acc, replace(trim($row[0]), /\s/,"_")),trim($row[1], "\r\n "))))))
| flatten tmp_{source_field}
| fields - tmp_{source_field}
