'How to convert all fields names in logstash filter starting with string to integer

i have tried this block without success i haven't find a proper way how to use wildcards

filter {
   if [fieldname] =~ /^STAGED.*/ {
        mutate {
            convert => {"[fieldname]" => "integer"}
        }
    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source