# Having trouble with field mappings types

**URL:** <https://discuss.elastic.co/t/having-trouble-with-field-mappings-types/265109>\
**Category:** Elasticsearch\
**Created:** [February 22, 2021, 6:28pm UTC](https://discuss.elastic.co/t/having-trouble-with-field-mappings-types/265109 "2021-02-22T18:28:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lostsoul352](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lostsoul352](https://discuss.elastic.co/u/lostsoul352)\
**Post date:** [February 22, 2021, 6:28pm UTC](https://discuss.elastic.co/t/having-trouble-with-field-mappings-types/265109/1 "2021-02-22T18:28:34Z")

</div>

**ELK stack 7.11**

I'm having some trouble getting my field mappings types. This is a snippet of my logstash configuration which I've added to include some new fields into an index.

` if [log_message] =~ /TP status:/ { grok { break_on_match => true match => ["log_message", "TP status: CPU-time=%{BASE10NUM:node_cputime:float}, threads=%{BASE10NUM:node_curr_threads:int} \(max=%{BASE10NUM:node_max_threads:int}, idle=%{BASE10NUM:node_idle_threads:int}, queueLength=%{BASE10NUM:node_queue_length:int}, queueAgeMs=%{BASE10NUM:node_queue_age:float}\), CPU load=%{BASE10NUM:node_cpu_load:float}"] } }`

Yet all the the fields I've mapped come out as strings. They all have the correct values, but as strings. Is there a better way of doing this?

Also, somethings changed in version 7.11. Whenever I introduce new fields into my index I would go and refresh the fields list from Index Management. That option is missing now. What's the new method.

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [February 22, 2021, 7:25pm UTC](https://discuss.elastic.co/t/having-trouble-with-field-mappings-types/265109/2 "2021-02-22T19:25:39Z")

</div>

I would set the field types in the [elastic index mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html) and not worry about doing that in Logstash. I don't believe what you set the field types in Logstash has anything to do with how they are stored in Elastic index.

---

<div class="post-metadata">

**Author:** ![lostsoul352](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lostsoul352](https://discuss.elastic.co/u/lostsoul352)\
**Post date:** [February 22, 2021, 7:35pm UTC](https://discuss.elastic.co/t/having-trouble-with-field-mappings-types/265109/3 "2021-02-22T19:35:41Z")

</div>

They certainly did in the past. I'm not sure if anythings changed in 7.11, but I believe I was using a previous 7 series version before and field types came from logstash. I have various fields in my index which are numeric types that have been set by logstash alone.

Can field types be set using the Kibana interface? Or do you have to make an API call to elastic to do that?

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [February 22, 2021, 7:48pm UTC](https://discuss.elastic.co/t/having-trouble-with-field-mappings-types/265109/4 "2021-02-22T19:48:39Z")

</div>

[API call](https://www.elastic.co/guide/en/elasticsearch/reference/current/explicit-mapping.html).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 22, 2021, 10:56pm UTC](https://discuss.elastic.co/t/having-trouble-with-field-mappings-types/265109/5 "2021-02-22T22:56:46Z")

</div>

> [@lostsoul352](#):
>
> They certainly did in the past

They may have aligned, but it was never a guarantee. The only guarantee is to define a mapping.

---

<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:** [March 22, 2021, 10:57pm UTC](https://discuss.elastic.co/t/having-trouble-with-field-mappings-types/265109/6 "2021-03-22T22:57:18Z")

</div>

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