From a41950be8bb01fc468fe8ba0e8d73b7e0f8f138c Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Thu, 16 Apr 2020 13:12:28 -0400 Subject: [PATCH] Fix typo --- .../common/types/models/agent_config.ts | 12 ++++++---- .../server/services/agent_config.test.ts | 24 +++++++++++-------- .../server/services/agent_config.ts | 12 ++++++---- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/x-pack/plugins/ingest_manager/common/types/models/agent_config.ts b/x-pack/plugins/ingest_manager/common/types/models/agent_config.ts index 429aaf38f3953..5c9bfca883ca1 100644 --- a/x-pack/plugins/ingest_manager/common/types/models/agent_config.ts +++ b/x-pack/plugins/ingest_manager/common/types/models/agent_config.ts @@ -59,10 +59,12 @@ export interface FullAgentConfig { }; datasources: FullAgentConfigDatasource[]; revision?: number; - 'settings.monitoring'?: { - use_output: string; - enabled: boolean; - metrics: boolean; - logs: boolean; + settings?: { + monitoring: { + use_output: string; + enabled: boolean; + metrics: boolean; + logs: boolean; + }; }; } diff --git a/x-pack/plugins/ingest_manager/server/services/agent_config.test.ts b/x-pack/plugins/ingest_manager/server/services/agent_config.test.ts index ec9eaf6d9f083..19203c83be099 100644 --- a/x-pack/plugins/ingest_manager/server/services/agent_config.test.ts +++ b/x-pack/plugins/ingest_manager/server/services/agent_config.test.ts @@ -83,11 +83,13 @@ describe('agent config', () => { }, datasources: [], revision: 1, - 'settings.monitoring': { - use_output: 'default', - enabled: true, - logs: true, - metrics: false, + settings: { + monitoring: { + use_output: 'default', + enabled: true, + logs: true, + metrics: false, + }, }, }); }); @@ -111,11 +113,13 @@ describe('agent config', () => { }, datasources: [], revision: 1, - 'settings.monitoring': { - use_output: 'default', - enabled: true, - logs: false, - metrics: true, + settings: { + monitoring: { + use_output: 'default', + enabled: true, + logs: false, + metrics: true, + }, }, }); }); diff --git a/x-pack/plugins/ingest_manager/server/services/agent_config.ts b/x-pack/plugins/ingest_manager/server/services/agent_config.ts index e866e89bade38..bd6a7bf17506c 100644 --- a/x-pack/plugins/ingest_manager/server/services/agent_config.ts +++ b/x-pack/plugins/ingest_manager/server/services/agent_config.ts @@ -330,11 +330,13 @@ class AgentConfigService { revision: config.revision, ...(config.monitoring_enabled && config.monitoring_enabled.length > 0 ? { - 'settings.monitoring': { - use_output: defaultOutput.name, - enabled: true, - logs: config.monitoring_enabled.indexOf('logs') >= 0, - metrics: config.monitoring_enabled.indexOf('metrics') >= 0, + settings: { + monitoring: { + use_output: defaultOutput.name, + enabled: true, + logs: config.monitoring_enabled.indexOf('logs') >= 0, + metrics: config.monitoring_enabled.indexOf('metrics') >= 0, + }, }, } : {}),