From 238244efd466d6bc40e1fe8a167f1fba840096e3 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 14 Feb 2023 10:47:34 -0500 Subject: [PATCH] [8.7] [ML] Allow splitting by field of `ip` type for Change point detection (#151022) (#151144) # Backport This will backport the following commits from `main` to `8.7`: - [[ML] Allow splitting by field of `ip` type for Change point detection (#151022)](https://github.com/elastic/kibana/pull/151022) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Dima Arnautov --- .../change_point_detection_context.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx b/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx index 7c4980846a8d8..a30ef3cc4a997 100644 --- a/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx +++ b/x-pack/plugins/aiops/public/components/change_point_detection/change_point_detection_context.tsx @@ -20,6 +20,7 @@ import type { Filter, Query } from '@kbn/es-query'; import { usePageUrlState } from '@kbn/ml-url-state'; import { useTimefilter, useTimeRangeUpdates } from '@kbn/ml-date-picker'; import moment from 'moment'; +import { ES_FIELD_TYPES } from '@kbn/field-types'; import { DEFAULT_AGG_FUNCTION } from './constants'; import { useSplitFieldCardinality } from './use_split_field_cardinality'; import { @@ -163,7 +164,9 @@ export const ChangePointDetectionContextProvider: FC = ({ children }) => { ({ aggregatable, esTypes, displayName }) => aggregatable && esTypes && - esTypes.includes('keyword') && + esTypes.some((el) => + [ES_FIELD_TYPES.KEYWORD, ES_FIELD_TYPES.IP].includes(el as ES_FIELD_TYPES) + ) && !['_id', '_index'].includes(displayName) ); }, [dataView]);