Skip to content

Commit

Permalink
[Ingest Manager] Set _meta in the index.mappings (#72026)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
afharo and elasticmachine authored Jul 20, 2020
1 parent bf89b3c commit f331cc8
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 f331cc8

Please sign in to comment.