# Field conversion Query

**URL:** https://discuss.elastic.co/t/field-conversion-query/2204
**Category:** Logstash
**Created:** [June 9, 2015, 11:33am UTC](https://discuss.elastic.co/t/field-conversion-query/2204 "2015-06-09T11:33:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Saket\_Kumar](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Saket\_Kumar](https://discuss.elastic.co/u/Saket_Kumar)
#### Post date: [June 9, 2015, 11:33am UTC](https://discuss.elastic.co/t/field-conversion-query/2204/1 "2015-06-09T11:33:06Z")

</div>

Parsed XML correctly using Logstash & output it to Elasticsearch...  
now from Kibana observed the field "response.data.run.firstView.videoFrames.frame.VisuallyComplete" has data type "String"

Is there anyway to convert the data type while parsing thru logstash...

I tried couple of ways but that didnt work...

First try which failed:  
xpath =\> [  
"response/data/run/firstView/videoFrames/frame/@time", "Time\_fv",  
"response/data/run/firstView/videoFrames/frame/@VisuallyComplete", "Progress\_fv"  
]  
}  
mutate {convert =\> ["Progress\_fv", "integer"]}  
mutate {convert =\> ["Time\_fv", "float"]}

Result: I don't see any destination field at Kibana.

Second try which failed:

add\_field =\> {  
"Time\_fv" =\> "%{[response][data][run][firstView][videoFrames][frame][0][time][0]}"  
Progress\_fv =\> "%{[response][data][run][firstView][videoFrames][frame][0][VisuallyComplete][0]}"  
}  
mutate {convert =\> ["Progress\_fv", "integer"]}  
mutate {convert =\> ["Time\_fv", "float"]}

Result: field gets added but with single value for both.

Requirement:  
I have one Time array field and another of Progress %.  
1)response.data.run.firstView.videoFrames.frame.VisuallyComplete (Progress %)  
2) response.data.run.firstView.videoFrames.frame.time (Time ms)

When parsed XML i am able to search but their data type are String I need these fields to be converted to number so that i could put one at Y-Axis and another on X-Axis at Kibana.

Please help as always....i am really thankful for your valuable replies:)

---

<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: [July 6, 2017, 5:38am UTC](https://discuss.elastic.co/t/field-conversion-query/2204/2 "2017-07-06T05:38:04Z")

</div>


