I have a field "to_domains_temp" (copied from email recipients list, amount of email addresses is unpredictable), let's say "akii.suzuki@gmail.com;machael.miki@hotmail.com;nobuo.miki@outlook.com;wakako.seki@gmail.com"
how do I extract all the domains from the field? I tried below approach but seems like gsub does not work. Please kindly advise.
filter {
gsub => [
"to_domains_temp", "(\W|^)[\w.+-]{0,100}@", ";prefix@" #match and replace email prefix with ";prefix@"
]
kv {field_split => ";" value_split => "@" source => "to_domains_temp" target => "to_domains" allow_duplicate_values => false}
rename => {"to_domains.prefix" => "to_domain"}
}