# Data field pushed as "text" type in elastic

**URL:** <https://discuss.elastic.co/t/data-field-pushed-as-text-type-in-elastic/174336>\
**Category:** Elasticsearch\
**Created:** [March 28, 2019, 12:51pm UTC](https://discuss.elastic.co/t/data-field-pushed-as-text-type-in-elastic/174336 "2019-03-28T12:51:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nik\_1106](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik_1106/32/42971_2.png) [@Nik\_1106](https://discuss.elastic.co/u/Nik_1106)\
**Post date:** [March 28, 2019, 12:51pm UTC](https://discuss.elastic.co/t/data-field-pushed-as-text-type-in-elastic/174336/1 "2019-03-28T12:51:03Z")

</div>

I am trying to push SNMP trap output field of logstash to elastic. It is pushing as "text" type. I understand that "string" type data will be pushed as "text". I want it to be as **"keyword" type** to do some analytics on the data. I tried to change the data type with dynamic\_template, but it is still coming as "text" type. Here is the link for reference:  
[[https://www.elastic.co/guide/en/elasticsearch/reference/6.2/dynamic-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/dynamic-templates.html)]

And here is the Index file and output:

 ![index%20logstash](https://us1.discourse-cdn.com/elastic/original/3X/9/f/9f8fe2bd3b759e185cf36e60cea1d388385f18d5.png)

 ![index_result_logstash](https://us1.discourse-cdn.com/elastic/original/3X/e/e/eef348086c05bc17a7cfbb6efba9c914f3fdca34.png)

I want **"IF-MIB::ifAdminStatus"** in "keyword" type. Please suggest some way to change the data type of field.

---

<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 25, 2019, 12:51pm UTC](https://discuss.elastic.co/t/data-field-pushed-as-text-type-in-elastic/174336/2 "2019-04-25T12:51:23Z")

</div>

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