Elasticsearch convert filter not converting type to float

I am trying to run a script and take the output of the script in the command line as an input to elasticsearch. I am then trying to convert this input into a float, and log that through logstash.

My code currently looks like:

input {
exec {
command => "./cpu_usage.sh"
type => "float"
interval => 3
}
}

filter {
mutate {
add_field => {"cpu_usage" => "%{message}" }
}
mutate {
convert => {"%{cpu_usage}" => "float" }
}
}

output {
elasticsearch{
}
file {
path => "/Users/changeme/dev/mylogstash/pipeline_out.log"
}
stdout{}
}

However, when viewing in Kibana, the type of cpu_usage is a string. I have tried deleting and reindexing the database already, and cpu_usage is still a string. Why is this so?

I think this is a logstash question. It'd probably do better in that section.

I suspect this should read: convert => {"cpu_usage" => "float" }

I added this in, even though this is what I started with, and it works now. I think what may have happened is I did not delete the database after doing this initially, so it did not recognize the change.