From fbcf50cbe2b6a93536386c82d754a6a7c7f2b8e9 Mon Sep 17 00:00:00 2001 From: Jen Huang Date: Mon, 15 Jun 2020 17:59:30 -0700 Subject: [PATCH] Add dataset.type --- .../common/services/datasources_to_agent_inputs.test.ts | 4 ++-- .../common/services/datasources_to_agent_inputs.ts | 5 ++++- .../ingest_manager/common/types/models/agent_config.ts | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/ingest_manager/common/services/datasources_to_agent_inputs.test.ts b/x-pack/plugins/ingest_manager/common/services/datasources_to_agent_inputs.test.ts index df94168ec88d0..8c4e1b57e3707 100644 --- a/x-pack/plugins/ingest_manager/common/services/datasources_to_agent_inputs.test.ts +++ b/x-pack/plugins/ingest_manager/common/services/datasources_to_agent_inputs.test.ts @@ -106,7 +106,7 @@ describe('Ingest Manager - storedDatasourcesToAgentInputs', () => { id: 'some-uuid', name: 'mock-datasource', type: 'test-logs', - dataset: { namespace: 'default' }, + dataset: { namespace: 'default', type: 'test-logs' }, use_output: 'default', streams: [ { @@ -142,7 +142,7 @@ describe('Ingest Manager - storedDatasourcesToAgentInputs', () => { id: 'some-uuid', name: 'mock-datasource', type: 'test-logs', - dataset: { namespace: 'default' }, + dataset: { namespace: 'default', type: 'test-logs' }, use_output: 'default', streams: [ { diff --git a/x-pack/plugins/ingest_manager/common/services/datasources_to_agent_inputs.ts b/x-pack/plugins/ingest_manager/common/services/datasources_to_agent_inputs.ts index 1c677722c3bcd..15298607e32a1 100644 --- a/x-pack/plugins/ingest_manager/common/services/datasources_to_agent_inputs.ts +++ b/x-pack/plugins/ingest_manager/common/services/datasources_to_agent_inputs.ts @@ -24,7 +24,10 @@ export const storedDatasourcesToAgentInputs = ( id: datasource.id || datasource.name, name: datasource.name, type: input.type, - dataset: { namespace: datasource.namespace || 'default' }, + dataset: { + namespace: datasource.namespace || 'default', + type: input.type, + }, use_output: DEFAULT_OUTPUT.name, ...Object.entries(input.config || {}).reduce((acc, [key, { value }]) => { acc[key] = value; 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 36b3176ffa415..deb75daa8b6ea 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 @@ -39,7 +39,10 @@ export interface FullAgentConfigInput { id: string; name: string; type: string; - dataset: { namespace: string }; + dataset: { + namespace: string; + type: string; + }; use_output: string; package?: Pick; streams: FullAgentConfigInputStream[];