# Elasticsearch changed the field type automacatilly

**URL:** <https://discuss.elastic.co/t/elasticsearch-changed-the-field-type-automacatilly/112424>\
**Category:** Elasticsearch\
**Created:** [December 19, 2017, 11:42am UTC](https://discuss.elastic.co/t/elasticsearch-changed-the-field-type-automacatilly/112424 "2017-12-19T11:42:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joao/32/83447_2.png) [@joao](https://discuss.elastic.co/u/joao)\
**Post date:** [December 19, 2017, 11:42am UTC](https://discuss.elastic.co/t/elasticsearch-changed-the-field-type-automacatilly/112424/1 "2017-12-19T11:42:21Z")

</div>

Hello,

Today I saw a strange behavior in Elasticsearch.  
Yesterday I did this configuration:

This is my log:  
LIBIA|42383595187|IPASGO|10.240.0.108|2017-12-18|11:23:30|LF

I use this Grok:  
%{WORD:hostname}|%{WORD:username}|%{WORD:domain}|%{IP:clientip}|%{DATA:DateTime}|%{DATA:HourTime}|%{WORD:action}

But, today Elasticsearch changed the index's field type to "date", and now I have this message:

"Field Type Conflict: The type of this field changes across indices. It is unavailable for many analysis functions. The indices per type are as follows: "  
date logstash-2017.12.19  
text logstash-2017.12.18

Is it possible Elasticsearch change de index's field type automatically?  
What I need to do in this case?

Thank you very much.

---

<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:** [December 19, 2017, 11:58am UTC](https://discuss.elastic.co/t/elasticsearch-changed-the-field-type-automacatilly/112424/2 "2017-12-19T11:58:26Z")

</div>

If you don't provide any mapping then elasticsearch tries to automatically guess from the content.

If you sent one document as:

```auto
{
  "foo": "bar"
}

```

One day in index named `logstash-2017.12.18` and then:

```auto
{
  "foo": "2017-12-18"
}

```

in another index, the second one will be mapped as a `date`.

You need to provide mapping. You can use index template to automate that.

---

<div class="post-metadata">

**Author:** ![joao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joao/32/83447_2.png) [@joao](https://discuss.elastic.co/u/joao)\
**Post date:** [December 19, 2017, 7:02pm UTC](https://discuss.elastic.co/t/elasticsearch-changed-the-field-type-automacatilly/112424/3 "2017-12-19T19:02:44Z")

</div>

Thank you.  
I will see about it. 👍

---

<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 16, 2018, 7:02pm UTC](https://discuss.elastic.co/t/elasticsearch-changed-the-field-type-automacatilly/112424/4 "2018-01-16T19:02:52Z")

</div>

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