# Ignore malformed field when dynamic: strict

**URL:** https://discuss.elastic.co/t/ignore-malformed-field-when-dynamic-strict/87811
**Category:** Elasticsearch
**Created:** [May 31, 2017, 9:10pm UTC](https://discuss.elastic.co/t/ignore-malformed-field-when-dynamic-strict/87811 "2017-05-31T21:10:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nejczupan](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@nejczupan](https://discuss.elastic.co/u/nejczupan)
#### Post date: [May 31, 2017, 9:10pm UTC](https://discuss.elastic.co/t/ignore-malformed-field-when-dynamic-strict/87811/1 "2017-05-31T21:10:38Z")

</div>

I need to have dynamic:strict in my mapping because I have malformed JSON.  
I need to ignore malformed fields for example: (first normal field and secondly malformed)  
{  
key1: value1  
}  
{  
key which is 1: value1  
}  
"key which is 1" is a malformed field which occurs through dependencies and I cannot change it. It get's parsed because I parse k,v with '='  
How can I ignore field: "key which is 1" in my index?  
If I cannot simply ignore it, elasticsearch rejects the whole document. Which cannot happen. It should index document except this field.  
I will be able to set the field before it is indexed because of "dynamic":"strict

---

<div class="post-metadata">

### Author: ![Mike.Barretta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike.barretta/32/16688_2.png) [@Mike.Barretta](https://discuss.elastic.co/u/Mike.Barretta)
#### Post date: [May 31, 2017, 9:58pm UTC](https://discuss.elastic.co/t/ignore-malformed-field-when-dynamic-strict/87811/2 "2017-05-31T21:58:13Z")

</div>

Would you be able to send the bad JSON through an ingest node? If so, you can ignore the bad stuff via the [JSON processor](https://www.elastic.co/guide/en/elasticsearch/reference/master/json-processor.html).

---

<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: [June 28, 2017, 9:58pm UTC](https://discuss.elastic.co/t/ignore-malformed-field-when-dynamic-strict/87811/3 "2017-06-28T21:58:18Z")

</div>

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