Skip to content

[7.13] Allow disabling ignore_malformed on data stream's timestamp field #72446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

martijnvg
Copy link
Member

Backporting #72406 to 7.13 branch.

If index.mapping.ignore_malformed has been set to true then
here is no way to overwrite that to false for a data stream's
timestamp field.

Before this commit, validation would fail that disallow the usage
of ignore_malformed attribute on a data stream's timestamp field.

This commit allows the usage of ignore_malformed attribute,
so that index.mapping.ignore_malformed can be disabled for a
data stream's timestamp field. The ignore_malformed attribute
can only be set to false.

This allows the following index template:

PUT /_index_template/filebeat
{
    "index_patterns": [
        "filebeat-*"
    ],
    "template": {
        "settings": {
            "index": {
                "mapping.ignore_malformed": true
            }
        },
        "mappings": {
            "properties": {
                "@timestamp": {
                    "type": "date",
                    "ignore_malformed": false
                }
            }
        }
    },
    "data_stream": {}
}

Closes #71755

Backporting elastic#72406 to 7.13 branch.

If `index.mapping.ignore_malformed` has been set to `true` then
here is no way to overwrite that to `false` for a data stream's
timestamp field.

Before this commit, validation would fail that disallow the usage
of `ignore_malformed` attribute on a data stream's timestamp field.

This commit allows the usage of `ignore_malformed` attribute,
so that `index.mapping.ignore_malformed` can be disabled for a
data stream's timestamp field. The `ignore_malformed` attribute
can only be set to false.

This allows the following index template:

```
PUT /_index_template/filebeat
{
    "index_patterns": [
        "filebeat-*"
    ],
    "template": {
        "settings": {
            "index": {
                "mapping.ignore_malformed": true
            }
        },
        "mappings": {
            "properties": {
                "@timestamp": {
                    "type": "date",
                    "ignore_malformed": false
                }
            }
        }
    },
    "data_stream": {}
}
```

Closes elastic#71755
@martijnvg martijnvg added backport :Data Management/Data streams Data streams and their lifecycles labels Apr 29, 2021
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Apr 29, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (Team:Core/Features)

@martijnvg martijnvg merged commit 5dde08c into elastic:7.13 Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport :Data Management/Data streams Data streams and their lifecycles Team:Data Management Meta label for data/management team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants