import { EsNames } from './names' ; import mappings from '../../generated/mappings.json' ; export function getIndexTemplate ( esNames ) { const indexTemplateBody = { index_patterns : [ esNames . indexPatternWithVersion ] , template : { settings : { number_of_shards : 1 , auto_expand_replicas : '0-1' , 'index.lifecycle.name' : esNames . ilmPolicy , 'index.lifecycle.rollover_alias' : esNames . alias , 'index.hidden' : true , } , mappings , } , } ; return indexTemplateBody ; } export function getIlmPolicy ( ) { return { policy : { phases : { hot : { actions : { rollover : { max_size : '50GB' , max_age : '30d' , } , } , } , delete : { min_age : '90d' , actions : { delete : { } , } , } , } , } , } ; }