# Mapping conflict 4 fields are defined as several types ----

**URL:** <https://discuss.elastic.co/t/mapping-conflict-4-fields-are-defined-as-several-types/323529>\
**Category:** Kibana\
**Created:** [January 19, 2023, 3:34pm UTC](https://discuss.elastic.co/t/mapping-conflict-4-fields-are-defined-as-several-types/323529 "2023-01-19T15:34:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swathi12](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@Swathi12](https://discuss.elastic.co/u/Swathi12)\
**Post date:** [January 19, 2023, 3:34pm UTC](https://discuss.elastic.co/t/mapping-conflict-4-fields-are-defined-as-several-types/323529/1 "2023-01-19T15:34:00Z")

</div>

Hello

i found this error in Kibana -\> Stack Management

````auto
Mapping conflict

4 fields are defined as several types (string, integer, etc) across the indices that match this pattern. You may still be able to use these conflict fields in parts of Kibana, but they will be unavailable for functions that require Kibana to know their type. Correcting this issue will require reindexing your data.```

Not sure how to solve this. Can you help here please?
````

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [January 19, 2023, 3:39pm UTC](https://discuss.elastic.co/t/mapping-conflict-4-fields-are-defined-as-several-types/323529/2 "2023-01-19T15:39:56Z")

</div>

For each field, find what is the proper type. Why is Elastic seeing different types?

Some reasons:

. Elastic guesses the field type based on the first event ingested. If it's a string field and it sees numbers first, it guesses wrong. Define mapping for the filed to fix.

. Same field name from different data sources but fields are of different format. Fix a data source, map or split into different fields.

When you define mapping for the fields, the index will have to "roll over" for the mapping to take effect. If you want the old data fixed, you have to reindex.

---

<div class="post-metadata">

**Author:** ![Swathi12](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@Swathi12](https://discuss.elastic.co/u/Swathi12)\
**Post date:** [January 19, 2023, 3:50pm UTC](https://discuss.elastic.co/t/mapping-conflict-4-fields-are-defined-as-several-types/323529/3 "2023-01-19T15:50:57Z")

</div>

Thank you @rugenl  
i have example here:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/2/9277cd0e2fc416792362692c29780adeecdcdfa9.png)

Can you tell how exactly i have to solve this? -i never did before

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [January 20, 2023, 2:27am UTC](https://discuss.elastic.co/t/mapping-conflict-4-fields-are-defined-as-several-types/323529/4 "2023-01-20T02:27:52Z")

</div>

It might be easiest to get all on the same version of metricbeat. You probably have no control over those fields,

Should he different versions go into different data streams?

---

<div class="post-metadata">

**Author:** ![Ayush\_Mathur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayush_mathur/32/77134_2.png) [@Ayush\_Mathur](https://discuss.elastic.co/u/Ayush_Mathur)\
**Post date:** [January 23, 2023, 2:50pm UTC](https://discuss.elastic.co/t/mapping-conflict-4-fields-are-defined-as-several-types/323529/5 "2023-01-23T14:50:34Z")

</div>

By logic, `limit_in_bytes` must be long type field and should not be stored as Text. So to resolve the above, you need to:

1. update your index template and provide mapping explicitly as long for this field
2. reindex the 2 indices mentioned in keyword to a new index. The new index will store the values as long since you updated the template mapping.
3. Provide alias to your new index (regex or common part of indices should be OK since patterns is created out of it).
4. Delete the old indices which are mentioned in `keyword` part.

---

<div class="post-metadata">

**Author:** ![Swathi12](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@Swathi12](https://discuss.elastic.co/u/Swathi12)\
**Post date:** [January 25, 2023, 2:45pm UTC](https://discuss.elastic.co/t/mapping-conflict-4-fields-are-defined-as-several-types/323529/6 "2023-01-25T14:45:14Z")

</div>

@Ayush_Mathur

1. i am not sure where and how to update the index template..

2. i just try this way but its not working and the error field i can't delete

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/9/199bd080f70830bc6b2e79aa1a0c7aea1cff1ce4.png)

1. can not delete the wrong field also  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/5/a53db468f2d4a4186a2e59f4a969b85660ad73c5.png)

---

<div class="post-metadata">

**Author:** ![Ayush\_Mathur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayush_mathur/32/77134_2.png) [@Ayush\_Mathur](https://discuss.elastic.co/u/Ayush_Mathur)\
**Post date:** [January 25, 2023, 4:06pm UTC](https://discuss.elastic.co/t/mapping-conflict-4-fields-are-defined-as-several-types/323529/7 "2023-01-25T16:06:13Z")

</div>

@Swathi12 do the following:

1. get your index details using `GET ${YOUR_INDEX_NAME}` -\> the output will show you the index template being used, copy the name of template.
2. `GET _index_template/${YOUR_INDEX_TEMPLATE}` -\> this will give you settings+mappings defined for your index template, copy the relevant section for conflicting field.
3. `PUT \_index\_template/${YOUR\_INDEX\_TEMPLATE} { "template": { "mappings": { "properties" : { "${YOUR\_FILD\_NAME}": { "type" : "long" } } } } } -\> you should get acknowledgement as output.
4. Create a new index following the regex or `index_pattern` defined for `${YOUR_INDEX_TEMPLATE}` by: `PUT ${NEW_INDEX_NAME}`.
5. Reindex you data from conflicting indices to the new index created in Step # 4 following: [Reindex API | Elasticsearch Guide [8.6] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.6/docs-reindex.html#docs-reindex-multiple-sources)
6. Delete the older or conflicting indices once reindexing is complete.

---

<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:** [February 22, 2023, 4:07pm UTC](https://discuss.elastic.co/t/mapping-conflict-4-fields-are-defined-as-several-types/323529/8 "2023-02-22T16:07:11Z")

</div>

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