diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.test.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.test.ts index ebffc0064b989..d759dec042247 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.test.ts @@ -188,7 +188,7 @@ processors: }); expect(pipelineInstall.contentForInstallation).toMatchInlineSnapshot( - `"{\\"processors\\":[{\\"set\\":{\\"field\\":\\"test\\",\\"value\\":\\"toto\\"}},{\\"pipeline\\":{\\"name\\":\\"global@custom\\",\\"ignore_missing_pipeline\\":true}},{\\"pipeline\\":{\\"name\\":\\"logs@custom\\",\\"ignore_missing_pipeline\\":true}},{\\"pipeline\\":{\\"name\\":\\"logs-test@custom\\",\\"ignore_missing_pipeline\\":true}}]}"` + `"{\\"processors\\":[{\\"set\\":{\\"field\\":\\"test\\",\\"value\\":\\"toto\\"}},{\\"pipeline\\":{\\"name\\":\\"global@custom\\",\\"ignore_missing_pipeline\\":true,\\"description\\":\\"[Fleet] Global pipeline for all data streams\\"}},{\\"pipeline\\":{\\"name\\":\\"logs@custom\\",\\"ignore_missing_pipeline\\":true,\\"description\\":\\"[Fleet] Pipeline for all data streams of type \`logs\`\\"}},{\\"pipeline\\":{\\"name\\":\\"logs-test@custom\\",\\"ignore_missing_pipeline\\":true,\\"description\\":\\"[Fleet] Pipeline for the \`test\` dataset\\"}}]}"` ); }); @@ -231,12 +231,15 @@ processors: - pipeline: name: global@custom ignore_missing_pipeline: true + description: '[Fleet] Global pipeline for all data streams' - pipeline: name: logs@custom ignore_missing_pipeline: true + description: '[Fleet] Pipeline for all data streams of type \`logs\`' - pipeline: name: logs-test.access@custom ignore_missing_pipeline: true + description: '[Fleet] Pipeline for the \`test.access\` dataset' - reroute: tag: test.access dataset: test.reroute @@ -280,7 +283,7 @@ processors: }); expect(pipelineInstall.contentForInstallation).toMatchInlineSnapshot( - `"{\\"processors\\":[{\\"set\\":{\\"field\\":\\"test\\",\\"value\\":\\"toto\\"}},{\\"pipeline\\":{\\"name\\":\\"global@custom\\",\\"ignore_missing_pipeline\\":true}},{\\"pipeline\\":{\\"name\\":\\"logs@custom\\",\\"ignore_missing_pipeline\\":true}},{\\"pipeline\\":{\\"name\\":\\"logs-test.access@custom\\",\\"ignore_missing_pipeline\\":true}},{\\"reroute\\":{\\"tag\\":\\"test.access\\",\\"dataset\\":\\"test.reroute\\",\\"namespace\\":\\"default\\",\\"if\\":\\"true == true\\"}}]}"` + `"{\\"processors\\":[{\\"set\\":{\\"field\\":\\"test\\",\\"value\\":\\"toto\\"}},{\\"pipeline\\":{\\"name\\":\\"global@custom\\",\\"ignore_missing_pipeline\\":true,\\"description\\":\\"[Fleet] Global pipeline for all data streams\\"}},{\\"pipeline\\":{\\"name\\":\\"logs@custom\\",\\"ignore_missing_pipeline\\":true,\\"description\\":\\"[Fleet] Pipeline for all data streams of type \`logs\`\\"}},{\\"pipeline\\":{\\"name\\":\\"logs-test.access@custom\\",\\"ignore_missing_pipeline\\":true,\\"description\\":\\"[Fleet] Pipeline for the \`test.access\` dataset\\"}},{\\"reroute\\":{\\"tag\\":\\"test.access\\",\\"dataset\\":\\"test.reroute\\",\\"namespace\\":\\"default\\",\\"if\\":\\"true == true\\"}}]}"` ); }); }); diff --git a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.ts b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.ts index 9c244821fd013..28027093853bc 100644 --- a/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.ts +++ b/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/helpers.ts @@ -80,25 +80,30 @@ export function addCustomPipelineAndLocalRoutingRulesProcessor( pipeline.dataStream?.routing_rules?.find( (rule) => rule.source_dataset === pipeline.dataStream?.dataset )?.rules ?? []; + const customPipelineProcessors = [ { pipeline: { name: 'global@custom', ignore_missing_pipeline: true, + description: '[Fleet] Global pipeline for all data streams', }, }, { pipeline: { name: `${pipeline.dataStream.type}@custom`, ignore_missing_pipeline: true, + description: `[Fleet] Pipeline for all data streams of type \`${pipeline.dataStream.type}\``, }, }, ...(pipeline.dataStream.package ? [ { pipeline: { - name: `${pipeline.dataStream.type}-${pipeline.dataStream.package}@custom`, + // This pipeline name gets the `.package` suffix to avoid conflicts with the pipeline name for the dataset below + name: `${pipeline.dataStream.type}-${pipeline.dataStream.package}.package@custom`, ignore_missing_pipeline: true, + description: `[Fleet] Pipeline for all data streams of type \`${pipeline.dataStream.type}\` defined by the \`${pipeline.dataStream.package}\` integration`, }, }, ] @@ -107,6 +112,7 @@ export function addCustomPipelineAndLocalRoutingRulesProcessor( pipeline: { name: `${pipeline.dataStream.type}-${pipeline.dataStream.dataset}@custom`, ignore_missing_pipeline: true, + description: `[Fleet] Pipeline for the \`${pipeline.dataStream.dataset}\` dataset`, }, }, ];