# Field conversion

**URL:** <https://discuss.elastic.co/t/field-conversion/107086>\
**Category:** Logstash\
**Created:** [November 9, 2017, 6:24pm UTC](https://discuss.elastic.co/t/field-conversion/107086 "2017-11-09T18:24:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jspeer](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jspeer](https://discuss.elastic.co/u/jspeer)\
**Post date:** [November 9, 2017, 6:24pm UTC](https://discuss.elastic.co/t/field-conversion/107086/1 "2017-11-09T18:24:51Z")

</div>

I'm trying to convert from strings to floats, in logstash, and push this to elasticsearch, I've deleted the index, however once it's created the field is still of type string.

This is the field I'm splitting, and converting:

```
nagios.results load average: 6.61, 7.86, 9.57

```

This is the part of the config doing split and conversion:

```
if [nagios][service] == "CPU Load" {
  mutate {
     split => { "[nagios]results" => " " }
     add_field => ["load", "%{[nagios]results[2]}" ]
  }

  mutate {
     convert => { "load" => "float" }
  }
}

```

I've deleted the index, and the index pattern, however when the index is recreated, the load is still of type string. In this instance it would be:

```
load 6.61

```

Is there a step I'm missing?

---

<div class="post-metadata">

**Author:** ![jspeer](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jspeer](https://discuss.elastic.co/u/jspeer)\
**Post date:** [November 9, 2017, 8:59pm UTC](https://discuss.elastic.co/t/field-conversion/107086/2 "2017-11-09T20:59:10Z")

</div>

Not sure why it hadn't updated the index, however it's now working properly.

---

<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:** [December 7, 2017, 9:00pm UTC](https://discuss.elastic.co/t/field-conversion/107086/3 "2017-12-07T21:00:04Z")

</div>

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