From f5716c4db75e6a0dae647ded76bbad87ff1e76ef Mon Sep 17 00:00:00 2001 From: Matthew Kime Date: Fri, 18 Oct 2024 13:48:57 -0500 Subject: [PATCH] [ip location processor] Add mmdb suffix to db file names (#196788) ## Summary Simply adds the mmdb suffix to the db names. Closes https://github.com/elastic/kibana/issues/196745 (cherry picked from commit f789ba61d4ca675bf6ea35f4c1f5fb033363e06a) --- .../components/processor_form/processors/ip_location.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/ip_location.tsx b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/ip_location.tsx index d1b8fbd7ea513..765c482f1c86b 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/ip_location.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/ip_location.tsx @@ -27,12 +27,14 @@ import { PropertiesField } from './common_fields/properties_field'; import type { GeoipDatabase } from '../../../../../../../common/types'; import { getTypeLabel } from '../../../../../sections/manage_processors/constants'; +const extension = '.mmdb'; + const fieldsConfig: FieldsConfig = { /* Optional field config */ database_file: { type: FIELD_TYPES.COMBO_BOX, - deserializer: to.arrayOfStrings, - serializer: (v: string[]) => (v.length ? v[0] : undefined), + deserializer: (v: unknown) => to.arrayOfStrings(v).map((str) => str?.split(extension)[0]), + serializer: (v: string[]) => (v.length ? `${v[0]}${extension}` : undefined), label: i18n.translate('xpack.ingestPipelines.pipelineEditor.ipLocationForm.databaseFileLabel', { defaultMessage: 'Database file (optional)', }),