# New fields not in elasticsearch template

**URL:** <https://discuss.elastic.co/t/new-fields-not-in-elasticsearch-template/79692>\
**Category:** Elasticsearch\
**Created:** [March 23, 2017, 6:44am UTC](https://discuss.elastic.co/t/new-fields-not-in-elasticsearch-template/79692 "2017-03-23T06:44:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [March 23, 2017, 6:44am UTC](https://discuss.elastic.co/t/new-fields-not-in-elasticsearch-template/79692/1 "2017-03-23T06:44:26Z")

</div>

What happens when my logstash has a new field e,g. field33 which I did not have a matching entry in the elasticsearch template?

Will records with the field33 be automatically discarded

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 23, 2017, 6:57am UTC](https://discuss.elastic.co/t/new-fields-not-in-elasticsearch-template/79692/2 "2017-03-23T06:57:55Z")

</div>

Mapping will be updated and document indexed.

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [March 23, 2017, 7:04am UTC](https://discuss.elastic.co/t/new-fields-not-in-elasticsearch-template/79692/3 "2017-03-23T07:04:49Z")

</div>

I am having this problem now.

field33 is a ip address

If I do this

"field33": {  
"type": "ip"

```
    }

```

I will get this error

s"=\>400, "error"=\>{"type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to pars  
e", "caused\_by"=\>{"type"=\>"illegal\_state\_exception", "reason"=\>"Mixing up field  
types: class org.elasticsearch.index.mapper.core.LongFieldMapper$LongFieldType !  
= class org.elasticsearch.index.mapper.ip.IpFieldMapper$IpFieldType on field field33"}}}}, :level=\>:warn}←[0m

So I am forced to not do any mapping at the template level

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 23, 2017, 10:22am UTC](https://discuss.elastic.co/t/new-fields-not-in-elasticsearch-template/79692/4 "2017-03-23T10:22:33Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

I guess you may be have already a mapping?  
You need to reindex (drop the index and create again).

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [March 27, 2017, 2:06am UTC](https://discuss.elastic.co/t/new-fields-not-in-elasticsearch-template/79692/5 "2017-03-27T02:06:56Z")

</div>

I have managed to solve the problem. It is probably caused by multiple template being applied to the same index and these templates had different type for the same field.

I am very sure that I did not apply multiple templates to the same index but it happened. What I did was to delete all custom template and re-add them one by one.

---

<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:** [April 24, 2017, 2:07am UTC](https://discuss.elastic.co/t/new-fields-not-in-elasticsearch-template/79692/6 "2017-04-24T02:07:34Z")

</div>

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