esArchiver delete auto-created v2 migration indices like .kibana_8.0.0

This commit is contained in:
Rudolf Meijering 2021-01-21 23:48:27 +01:00
parent a9a935558c
commit aba78bdb0f

View file

@ -77,7 +77,7 @@ export async function migrateKibanaIndex({
async function fetchKibanaIndices(client: Client) {
const kibanaIndices = await client.cat.indices({ index: '.kibana*', format: 'json' });
const isKibanaIndex = (index: string) =>
/^\.kibana(:?_\d*)?$/.test(index) || /^\.kibana_(pre)*\d+\.\d+\.\d+_\d\d\d$/.test(index);
/^\.kibana(:?_\d*)?$/.test(index) || /^\.kibana_(pre)*\d+\.\d+\.\d+/.test(index);
return kibanaIndices.map((x: { index: string }) => x.index).filter(isKibanaIndex);
}