# Ignore\_malformed within an object

**URL:** <https://discuss.elastic.co/t/ignore-malformed-within-an-object/363147>\
**Category:** Elasticsearch\
**Created:** [July 15, 2024, 12:09pm UTC](https://discuss.elastic.co/t/ignore-malformed-within-an-object/363147 "2024-07-15T12:09:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TiredPanda](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@TiredPanda](https://discuss.elastic.co/u/TiredPanda)\
**Post date:** [July 15, 2024, 12:09pm UTC](https://discuss.elastic.co/t/ignore-malformed-within-an-object/363147/1 "2024-07-15T12:09:02Z")

</div>

Hi, can anyone provide confirmation or clarification if using ignore\_malformed on a property within an object is supported.

The docs say they are not supported on object types but does this extend to properties within the object?

for example :

```json
"dynamic_templates": [
        {
          "custom_date_iso": {
            "path_match": "custom.*",
            "match_mapping_type": "date",
            "mapping": {
              "format": "strict_date_optional_time",
              "ignore_malformed": true,
              "type": "date"
            }
          }
        }
]

```

with the above dynamic mapping, when I submit a doc

```auto
{
  "custom.date": "1970-01-01"
}

```

it results in:

```auto
 "properties": {
        "custom": {
          "properties": {
            "date": {
              "type": "date",
              "format": "strict_date_optional_time",
              "ignore_malformed": true
            }
          }
        }
      }

```

This allows me to send bad data for "custom.date" and have it ignored which is what I want.

Is this a supported use case for ignore\_malformed?

Thanks

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [July 15, 2024, 1:30pm UTC](https://discuss.elastic.co/t/ignore-malformed-within-an-object/363147/2 "2024-07-15T13:30:29Z")

</div>

Hi @TiredPanda

I think it's about which type ignore\_malformed is supported too.

The doc says that for the Nested data type, Object data type, Range data types it is not supported.

But for is supported for types: Numeric, Boolean, Date, Date nanoseconds, Geopoint, Geoshape, IP.  
So if you test for a text or keyword type you will see that it is not supported.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [July 15, 2024, 1:37pm UTC](https://discuss.elastic.co/t/ignore-malformed-within-an-object/363147/3 "2024-07-15T13:37:53Z")

</div>

> [@TiredPanda](#):
>
> The docs say they are not supported on object types but does this extend to properties within the object?

This means that the ignore\_malformed will not work for object fields.

For example, if you send this to elasticsearch:

```auto
{
    "custom": "some value"
}

```

And then, try to send this:

```auto
{
    "custom" : {
        "nested": "some value"
    }
}

```

Then the second document will be rejected completely, regardless if you have ignore\_malformed configured.

The case you mentioned is different, because you would have something like this:

```auto
{
    "custom": {
        "date": "1970-01-01"
    }
}

```

and

```auto
{
    "custom": {
        "date": "this-is-not-a-valid-date"
    }
}

```

In this case, only the `custom.date` field would be rejected, not the entire document.
