# Why am i getting .keyword for my feilds in index pattern

**URL:** <https://discuss.elastic.co/t/why-am-i-getting-keyword-for-my-feilds-in-index-pattern/137983>\
**Category:** Elasticsearch\
**Created:** [June 29, 2018, 2:08pm UTC](https://discuss.elastic.co/t/why-am-i-getting-keyword-for-my-feilds-in-index-pattern/137983 "2018-06-29T14:08:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vebabu](https://avatars.discourse-cdn.com/v4/letter/v/919ad9/32.png) [@vebabu](https://discuss.elastic.co/u/vebabu)\
**Post date:** [June 29, 2018, 2:08pm UTC](https://discuss.elastic.co/t/why-am-i-getting-keyword-for-my-feilds-in-index-pattern/137983/1 "2018-06-29T14:08:19Z")

</div>

Hi All,

I am new to kibana and i am trying to transfer my data from aws service to kibana.  
Once I receive the data from AWS and create a index patter i can see two fields created for every 1 filed of my original data. For example my original data is having a field "activity" and in my discover tab I can see only the field "activity"but in my index patter I have "activity" and "activity.keyword" .

Why .keyword is created for my fields ? and what is the use of them and how to avoid them ?

 ![33%20AM](https://us1.discourse-cdn.com/elastic/original/3X/6/a/6a5e05e919fa5f66406540965f61c0d649fc9d05.png)  
 ![35%20AM](https://us1.discourse-cdn.com/elastic/original/3X/c/6/c606f54ae1739d4f4d701512be6e4e20220db3a6.png)

---

<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:** [June 29, 2018, 2:26pm UTC](https://discuss.elastic.co/t/why-am-i-getting-keyword-for-my-feilds-in-index-pattern/137983/2 "2018-06-29T14:26:47Z")

</div>

It's because you did not define a proper mapping so elasticsearch creates a default one for you.

---

<div class="post-metadata">

**Author:** ![vebabu](https://avatars.discourse-cdn.com/v4/letter/v/919ad9/32.png) [@vebabu](https://discuss.elastic.co/u/vebabu)\
**Post date:** [June 29, 2018, 2:39pm UTC](https://discuss.elastic.co/t/why-am-i-getting-keyword-for-my-feilds-in-index-pattern/137983/3 "2018-06-29T14:39:19Z")

</div>

How should i do the proper mapping ? can you please advice ? I am new to kibana and I don't find any option for mapping when i create a index patter.

Below are the screen I am getting when i try to create the index pattern

 ![14%20AM](https://us1.discourse-cdn.com/elastic/original/3X/f/7/f7ca24ad84a64a74190cb93f7c3f42a3d2da1bd0.png)  
 ![34%20AM](https://us1.discourse-cdn.com/elastic/original/3X/9/6/96eade5e2f97ba51d150501b3a30d09de8ccd1e8.png)  
 ![57%20AM](https://us1.discourse-cdn.com/elastic/original/3X/a/4/a4d2d30646fbba8333e0d56b67761f6635e7a958.png)

The moment i hit the create button my index pattern is created. Please advice

Thanks in Advance!!  
Venkatesh

---

<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:** [June 29, 2018, 9:01pm UTC](https://discuss.elastic.co/t/why-am-i-getting-keyword-for-my-feilds-in-index-pattern/137983/4 "2018-06-29T21:01:45Z")

</div>

It's not a Kibana question. This is something to solve on elasticsearch side.

Read [https://www.elastic.co/guide/en/elasticsearch/reference/6.3/indices-put-mapping.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/indices-put-mapping.html) or [https://www.elastic.co/guide/en/elasticsearch/reference/6.3/indices-create-index.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/indices-create-index.html)

Basically:

```auto
DELETE iotdemo101
PUT iotdemo101 
{
    "mappings" : {
        "_doc" : {
            "properties" : {
                "device" : { "type" : "text" }
            }
        }
    }
}
POST iotdemo101/_doc
{
  "device": "foo"
}

```

---

<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:** [July 27, 2018, 9:01pm UTC](https://discuss.elastic.co/t/why-am-i-getting-keyword-for-my-feilds-in-index-pattern/137983/5 "2018-07-27T21:01:46Z")

</div>

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