# Data type conversion problem

**URL:** https://discuss.elastic.co/t/data-type-conversion-problem/76486
**Category:** Kibana
**Created:** [February 25, 2017, 3:24pm UTC](https://discuss.elastic.co/t/data-type-conversion-problem/76486 "2017-02-25T15:24:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ximeng\_Zhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ximeng_zhao/32/15775_2.png) [@Ximeng\_Zhao](https://discuss.elastic.co/u/Ximeng_Zhao)
#### Post date: [February 25, 2017, 3:24pm UTC](https://discuss.elastic.co/t/data-type-conversion-problem/76486/1 "2017-02-25T15:24:14Z")

</div>

Hello All,

I loaded my csv file via logstash without any problem. I want to convert Low, High, Open , Close from String to Float, and I used mutate and convert in the logstash.conf but when I watch my data on Kibana, it's something look like this below, Low, High, Open and Close are still String, such as "High":163. How to make it as float so that I can do average operation on visualization, thanks for your answer.

JSON format on Kibana:

{  
"\_index": "bitcoin-prices",  
"\_type": "logs",  
"\_id": "AVpymmLhKDtxeN4i7W0P",  
"\_score": null,  
"\_source": {  
"High": 163,  
"Volume (BTC)": "41433.57691",  
"Volume (Currency)": "6434985.714",  
"Weighted Price": "155.3084767",  
"message": "2013-10-16,158.1,163,144.20004,152.83,41433.57691,6434985.714,155.3084767\r",  
"Date": "2013-10-16",  
"tags": [],  
"Open": 158.1,  
"path": "/Users/simon/Desktop/simon.csv",  
"@timestamp": "2017-02-25T00:10:04.122Z",  
"Low": 144.20004,  
"@version": "1",  
"host": "simons-MacBook-Air.local",  
"Close": 152.83  
},  
"fields": {  
"Date": [  
1381881600000  
],

Here's my logstash.conf:

input {  
file {  
path =\> "/Users/simon/Desktop/simon.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}  
filter {  
csv {  
separator =\> ","  
#Date,Open,High,Low,Close,Volume (BTC),Volume (Currency),Weighted Price  
columns =\> ["Date","Open","High","Low","Close","Volume (BTC)", "Volume (Currency)" ,"Weighted Price"]  
}  
mutate{  
convert =\> {"Low" =\> "float" }  
convert =\> {"High" =\> "float"}  
convert =\> {"Open" =\> "float"}  
convert =\> {"Close" =\> "float"}  
}  
}  
output {  
elasticsearch {  
hosts =\> "[http://localhost:9200](http://localhost:9200)"  
index =\> "bitcoin-prices"  
}

---

<div class="post-metadata">

### Author: ![Ximeng\_Zhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ximeng_zhao/32/15775_2.png) [@Ximeng\_Zhao](https://discuss.elastic.co/u/Ximeng_Zhao)
#### Post date: [February 25, 2017, 4:31pm UTC](https://discuss.elastic.co/t/data-type-conversion-problem/76486/2 "2017-02-25T16:31:24Z")

</div>

Problem solved, thanks

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 26, 2017, 2:14am UTC](https://discuss.elastic.co/t/data-type-conversion-problem/76486/3 "2017-02-26T02:14:45Z")

</div>

Solved how?

---

<div class="post-metadata">

### Author: ![Ximeng\_Zhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ximeng_zhao/32/15775_2.png) [@Ximeng\_Zhao](https://discuss.elastic.co/u/Ximeng_Zhao)
#### Post date: [February 26, 2017, 5:19am UTC](https://discuss.elastic.co/t/data-type-conversion-problem/76486/4 "2017-02-26T05:19:19Z")

</div>

go to index pattern, and click refresh.

---

<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: [March 26, 2017, 5:19am UTC](https://discuss.elastic.co/t/data-type-conversion-problem/76486/5 "2017-03-26T05:19:20Z")

</div>

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