# Logstash - cannot delete "\]" sign

**URL:** https://discuss.elastic.co/t/logstash-cannot-delete-sign/93974
**Category:** Logstash
**Created:** [July 20, 2017, 3:32pm UTC](https://discuss.elastic.co/t/logstash-cannot-delete-sign/93974 "2017-07-20T15:32:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rachel1](https://avatars.discourse-cdn.com/v4/letter/r/e0b2c6/32.png) [@rachel1](https://discuss.elastic.co/u/rachel1)
#### Post date: [July 20, 2017, 3:32pm UTC](https://discuss.elastic.co/t/logstash-cannot-delete-sign/93974/1 "2017-07-20T15:32:05Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![rach](https://avatars.discourse-cdn.com/v4/letter/r/ecb155/32.png) [@rach](https://discuss.elastic.co/u/rach)
#### Post date: [July 25, 2017, 8:09am UTC](https://discuss.elastic.co/t/logstash-cannot-delete-sign/93974/2 "2017-07-25T08:09:41Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 22, 2017, 8:09am UTC](https://discuss.elastic.co/t/logstash-cannot-delete-sign/93974/3 "2017-08-22T08:09:52Z")

</div>

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