Skip to content

Commit

Permalink
[7.x] [Ingest Manager] Set _meta in the index.mappings (elastic#72026
Browse files Browse the repository at this point in the history
…) (elastic#72426)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
afharo and elasticmachine authored Jul 20, 2020
1 parent 0bb721b commit 7202c4e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,15 @@ function getBaseTemplate(
packageName: string,
composedOfTemplates: string[]
): IndexTemplate {
// Meta information to identify Ingest Manager's managed templates and indices
const _meta = {
package: {
name: packageName,
},
managed_by: 'ingest-manager',
managed: true,
};

return {
// This takes precedence over all index templates installed by ES by default (logs-*-* and metrics-*-*)
// if this number is lower than the ES value (which is 100) this template will never be applied when a data stream
Expand Down Expand Up @@ -304,19 +313,14 @@ function getBaseTemplate(
date_detection: false,
// All the properties we know from the fields.yml file
properties: mappings.properties,
_meta,
},
// To be filled with the aliases that we need
aliases: {},
},
data_stream: {},
composed_of: composedOfTemplates,
_meta: {
package: {
name: packageName,
},
managed_by: 'ingest-manager',
managed: true,
},
_meta,
};
}

Expand Down

0 comments on commit 7202c4e

Please sign in to comment.