# Fields once created don't seem to go away even if all records with those fields are deleted

**URL:** <https://discuss.elastic.co/t/fields-once-created-dont-seem-to-go-away-even-if-all-records-with-those-fields-are-deleted/156100>\
**Category:** Kibana\
**Created:** [November 9, 2018, 7:17pm UTC](https://discuss.elastic.co/t/fields-once-created-dont-seem-to-go-away-even-if-all-records-with-those-fields-are-deleted/156100 "2018-11-09T19:17:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![grimespm](https://avatars.discourse-cdn.com/v4/letter/g/74df32/32.png) [@grimespm](https://discuss.elastic.co/u/grimespm)\
**Post date:** [November 9, 2018, 7:17pm UTC](https://discuss.elastic.co/t/fields-once-created-dont-seem-to-go-away-even-if-all-records-with-those-fields-are-deleted/156100/1 "2018-11-09T19:17:03Z")

</div>

i put some data into kibana that had some fields, and have since deleted the records containing those fields, but if i delete the index and create it again those fields show up. how can i get rid of them?

---

<div class="post-metadata">

**Author:** ![jen-huang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jen-huang/32/74327_2.png) [@jen-huang](https://discuss.elastic.co/u/jen-huang)\
**Post date:** [November 9, 2018, 7:38pm UTC](https://discuss.elastic.co/t/fields-once-created-dont-seem-to-go-away-even-if-all-records-with-those-fields-are-deleted/156100/2 "2018-11-09T19:38:59Z")

</div>

Hi, are you deleting and re-creating the Kibana index patterns? If so, your Elasticsearch index for those documents still has the same mappings. You can try [deleting the index](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/indices-delete-index.html) itself completely, or [updating the mappings](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/indices-put-mapping.html) to not include that field.

---

<div class="post-metadata">

**Author:** ![grimespm](https://avatars.discourse-cdn.com/v4/letter/g/74df32/32.png) [@grimespm](https://discuss.elastic.co/u/grimespm)\
**Post date:** [November 9, 2018, 7:53pm UTC](https://discuss.elastic.co/t/fields-once-created-dont-seem-to-go-away-even-if-all-records-with-those-fields-are-deleted/156100/3 "2018-11-09T19:53:03Z")

</div>

if i delete the index, do i lose all my data? i removed the index pattern via the normal management ui which i guess isn't the same. the mappings updating doesn't have a clear example of removing a mapping

---

<div class="post-metadata">

**Author:** ![jen-huang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jen-huang/32/74327_2.png) [@jen-huang](https://discuss.elastic.co/u/jen-huang)\
**Post date:** [November 9, 2018, 8:04pm UTC](https://discuss.elastic.co/t/fields-once-created-dont-seem-to-go-away-even-if-all-records-with-those-fields-are-deleted/156100/4 "2018-11-09T20:04:12Z")

</div>

Yes, deleting the index will remove all the data. You can [get the current mappings](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/indices-get-mapping.html) for the index first and edit the response to remove the field, then perform the update with that JSON.

For a simpler solution, you can also try running an [update by query](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html), which is basically a re-index into the same index name.

---

<div class="post-metadata">

**Author:** ![grimespm](https://avatars.discourse-cdn.com/v4/letter/g/74df32/32.png) [@grimespm](https://discuss.elastic.co/u/grimespm)\
**Post date:** [November 9, 2018, 9:28pm UTC](https://discuss.elastic.co/t/fields-once-created-dont-seem-to-go-away-even-if-all-records-with-those-fields-are-deleted/156100/5 "2018-11-09T21:28:14Z")

</div>

i can get the current mappings. how do i edit the response to remove the fields i want?

eg very specifically if i do GET lmec-performance/\_mapping  
i get  
{  
"lmec-performance": {  
"mappings": {  
"results": {  
"properties": {  
"blkio\_stats": {  
"properties": {  
"io\_service\_bytes\_recursive": {  
"properties": {  
"major": {  
"type": "long"  
},  
"minor": {  
"type": "long"  
},  
"op": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"value": {  
"type": "long"  
}  
}  
},  
"io\_serviced\_recursive": {  
"properties": {  
"major": {  
"type": "long"  
},  
"minor": {  
"type": "long"  
},  
"op": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"value": {  
"type": "long"  
}  
}  
}  
}  
},  
...

and i want the entire blkio\_stats section removed

---

<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:** [December 7, 2018, 9:33pm UTC](https://discuss.elastic.co/t/fields-once-created-dont-seem-to-go-away-even-if-all-records-with-those-fields-are-deleted/156100/6 "2018-12-07T21:33:57Z")

</div>

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