Always _doc if Beats major version is 7 and ES >= 6 #9573
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This only affects master and the Beats 7.x releases.
Testing Beats upgrade with ES master/alpha builds I found one can not create an index by putting an event into an non-existing index if the document type used in the template still states "doc". This could potentially prevent Beats from being able to index, depending on upgrade order (ES issue to be created).
As the index versioning is based on the Beats version, but not the ES version, we want to guarantee some kind of consistency, no matter when Beats or ES is updated and in which order. In case Beats is updated before Elasticsearch, then we want to guarantee the template already uses
_doc
, such that the template would be the same, no matter when Elasticsearch is updated.With this change the value of type in the template and when indexing will always be (independent of update order):