Skip to content

Commit

Permalink
Renamed ilm policy for event log so it is not prefixed with dot
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Apr 22, 2020
1 parent 65264aa commit d05f379
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions x-pack/plugins/event_log/server/es/names.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ describe('getEsNames()', () => {
expect(esNames.initialIndex).toEqual(`${base}-event-log-${version}-000001`);
expect(esNames.indexTemplate).toEqual(`${base}-event-log-${version}-template`);
});

test('ilm policy name does not contain dot prefix', () => {
const base = '.XYZ';
const esNames = getEsNames(base);
expect(esNames.ilmPolicy).toEqual('XYZ-event-log-policy');
});
});
5 changes: 4 additions & 1 deletion x-pack/plugins/event_log/server/es/names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ export interface EsNames {
export function getEsNames(baseName: string): EsNames {
const eventLogName = `${baseName}${EVENT_LOG_NAME_SUFFIX}`;
const eventLogNameWithVersion = `${eventLogName}${EVENT_LOG_VERSION_SUFFIX}`;
const eventLogPolicyName = `${
baseName.startsWith('.') ? baseName.substring(1) : baseName
}${EVENT_LOG_NAME_SUFFIX}`;
return {
base: baseName,
alias: eventLogNameWithVersion,
ilmPolicy: `${eventLogName}-policy`,
ilmPolicy: `${eventLogPolicyName}-policy`,
indexPattern: `${eventLogName}-*`,
indexPatternWithVersion: `${eventLogNameWithVersion}-*`,
initialIndex: `${eventLogNameWithVersion}-000001`,
Expand Down

0 comments on commit d05f379

Please sign in to comment.