# How to change type of field in logstash for xml plugin

**URL:** https://discuss.elastic.co/t/how-to-change-type-of-field-in-logstash-for-xml-plugin/282160
**Category:** Logstash
**Created:** [August 22, 2021, 8:43am UTC](https://discuss.elastic.co/t/how-to-change-type-of-field-in-logstash-for-xml-plugin/282160 "2021-08-22T08:43:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ankit-github-26](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankit-github-26/32/66756_2.png) [@Ankit-github-26](https://discuss.elastic.co/u/Ankit-github-26)
#### Post date: [August 22, 2021, 8:43am UTC](https://discuss.elastic.co/t/how-to-change-type-of-field-in-logstash-for-xml-plugin/282160/1 "2021-08-22T08:43:21Z")

</div>

## I want to change some field types from text(by default) to float for aggregation purpose from xml parsed data. kindly find my logstash configuration below

## xml { source =\> "[data][cdr]" target =\> "cdr" } mutate { rename =\> { "[cdr][inbound][flaw\_total]" =\> "cdr\_inbound\_flaw\_total" } convert =\> { "inbound\_mos" =\> "float" }

data is getting parsed from xml plugin but mutate filter is not working.  
Please help me on this

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [August 22, 2021, 1:00pm UTC](https://discuss.elastic.co/t/how-to-change-type-of-field-in-logstash-for-xml-plugin/282160/2 "2021-08-22T13:00:20Z")

</div>

The convert mutate has no effect on Elastic mappings. You still need to ensure your data is being [mapped as a float.](https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html)

```auto
PUT YOUR-INDEX-NAME
{
  "mappings": {
    "properties": {
      "inbound_mos": {
        "type": "float"
      }
    }
  }
}

```

---

<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: [September 19, 2021, 1:00pm UTC](https://discuss.elastic.co/t/how-to-change-type-of-field-in-logstash-for-xml-plugin/282160/3 "2021-09-19T13:00:36Z")

</div>

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