Logstash - cannot delete "]" sign

Hi!

I'm trying to convert a text type field into a float one in Logstash and ElasticSearch mapping.
field name: votingPercentage.
My log looks as follow: "votingPercentage = 0.13]"
Since there's a "]" sign in the end of the field's value - the ElasticSearch cannot map it into float.
In order to delete the "]" sign, I've tried to do the following configuration in logstash.conf file:

mutate {
gsub => [
"votingPercentage", "[]g]", " "
]
}

(using g as global)
This configuration has dropped the "]" sign and enabled the votingPercentage field to be mapped as float, but it has also dropped any appearance of the "g" letter in the field, so the result is: "votin Percenta e" is now the field name.

Can you please assist me?

I've found a solution for this issue:
mutate {
gsub => [ "votingPercentage", "]", " ]" ]
}
The field votingPercentage can be mapped into float type in Elasticserach.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.