# New Template vs Mutate vs Convert

**URL:** <https://discuss.elastic.co/t/new-template-vs-mutate-vs-convert/110758>\
**Category:** Elasticsearch\
**Created:** [December 7, 2017, 10:30pm UTC](https://discuss.elastic.co/t/new-template-vs-mutate-vs-convert/110758 "2017-12-07T22:30:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Guzzo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_guzzo/32/25188_2.png) [@Mark\_Guzzo](https://discuss.elastic.co/u/Mark_Guzzo)\
**Post date:** [December 7, 2017, 10:30pm UTC](https://discuss.elastic.co/t/new-template-vs-mutate-vs-convert/110758/1 "2017-12-07T22:30:02Z")

</div>

Hello,  
I just installed this (Elastic-6 with included Logstash and Kibana) and I've been playing around with data from my DHCP server.

I'm able to send a csv (powershell created) using filebeat and parsing with logstash csv filter with no problems... I also discovered the data defaults to strings... using csv convert fixed that and all is great!

Now comes the question:  
I want to have one of the fields "ScopeID" be an actual IP and not a number. I do not see this as something convert can do. So searching this website and others, seems the answer is to create a new Template.. OK.. WHY?

What is the difference between a new template and doing the conversion with mutate or convert? I haven't found any info on why/when one needs to create a new template and not leverage mutate or convert.

Not asking how to do it 😉 .. I just want to understand the why.

Thanks.

---

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [December 8, 2017, 3:18pm UTC](https://discuss.elastic.co/t/new-template-vs-mutate-vs-convert/110758/2 "2017-12-08T15:18:18Z")

</div>

The index mapping (which you could define in an index template) tells Elasticsearch how it should treat the data that you send it. You could send Elasticsearch a string that should be treated as a date, as an IP address, or simply as a string. The mapping is the way to tell Elasticsearch that. Think of it as Elasticsearch' data schema.

The mutate and convert transformations are something you do to a document before you send it to Elasticsearch for indexing. You are changing the source document from containing a string like for example `"42"` to containing a number like `42`.

---

<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:** [January 5, 2018, 3:18pm UTC](https://discuss.elastic.co/t/new-template-vs-mutate-vs-convert/110758/3 "2018-01-05T15:18:22Z")

</div>

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