# Do I need to convert fields in logstash if I have a index template in elastic?

**URL:** <https://discuss.elastic.co/t/do-i-need-to-convert-fields-in-logstash-if-i-have-a-index-template-in-elastic/230434>\
**Category:** Logstash\
**Created:** [April 29, 2020, 8:15pm UTC](https://discuss.elastic.co/t/do-i-need-to-convert-fields-in-logstash-if-i-have-a-index-template-in-elastic/230434 "2020-04-29T20:15:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)\
**Post date:** [April 29, 2020, 8:15pm UTC](https://discuss.elastic.co/t/do-i-need-to-convert-fields-in-logstash-if-i-have-a-index-template-in-elastic/230434/1 "2020-04-29T20:15:14Z")

</div>

Hi, I've been converting some fields in logstash, but I was wondering if I really need to do this if I have a index template with those fields already created in elastic

```auto
      mutate {
        convert => {
                "value" => "float"
                "hostid" => "integer"
                }
        }

```

in index template:

```auto
      },
      "value": {
        "type": "float"
      },
      "hostid": {
        "type": "long"
      },
```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 29, 2020, 11:45pm UTC](https://discuss.elastic.co/t/do-i-need-to-convert-fields-in-logstash-if-i-have-a-index-template-in-elastic/230434/2 "2020-04-29T23:45:52Z")

</div>

> [@ElasticLiver](#):
>
> I was wondering if I really need to do this if I have a index template with those fields already created in elastic

I do not believe you do. elasticsearch will attempt to parse the field according to the template.

---

<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:** [May 27, 2020, 11:46pm UTC](https://discuss.elastic.co/t/do-i-need-to-convert-fields-in-logstash-if-i-have-a-index-template-in-elastic/230434/3 "2020-05-27T23:46:10Z")

</div>

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