diff --git a/x-pack/legacy/plugins/uptime/common/constants/constants.ts b/x-pack/legacy/plugins/uptime/common/constants/constants.ts index 0c35bc97344864..e9e2dace123a1d 100644 --- a/x-pack/legacy/plugins/uptime/common/constants/constants.ts +++ b/x-pack/legacy/plugins/uptime/common/constants/constants.ts @@ -5,3 +5,5 @@ */ export const UNNAMED_LOCATION = 'Unnamed-location'; + +export const UPTIME_INDEX_PATTERN = 'heartbeat-8*'; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts b/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts index fc9013f4a844d1..265efe10e82ed9 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts +++ b/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts @@ -5,12 +5,12 @@ */ import { UMSavedObjectsAdapter } from './types'; -import uptimeIndexPattern from './heartbeat_index_pattern.json'; +import { UPTIME_INDEX_PATTERN } from '../../../../common/constants'; export const savedObjectsAdapter: UMSavedObjectsAdapter = { getUptimeIndexPattern: async client => { try { - return await client.get('index-pattern', uptimeIndexPattern.id); + return await client.get('index-pattern', UPTIME_INDEX_PATTERN); } catch (error) { return await client.create( 'index-pattern', @@ -19,7 +19,7 @@ export const savedObjectsAdapter: UMSavedObjectsAdapter = { title: 'heartbeat-8*', fields: '[]', }, - { id: uptimeIndexPattern.id, overwrite: false } + { id: UPTIME_INDEX_PATTERN, overwrite: false } ); } },