I have solved the problem using this code:
if [payload_humidity_value] { mutate { gsub => [ "payload_humidity_value", "%", "" ] convert => ["payload_humidity_value", "float" ] } }
Seems like the problem was at the syntax. Calling the field in this way gsub => [ "payload_humidity_value", "%", "" ]
solved it.
Notice that i am using Logstash_input_mongodb plugin to get data from MongoDB.