diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index bd5389b6..8d023fbe 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -31,3 +31,4 @@ "opensearch-anomaly-detection" ] } + diff --git a/public/components/DiscoverAction/GenerateAnomalyDetector.tsx b/public/components/DiscoverAction/GenerateAnomalyDetector.tsx index 0b93446c..357a0de6 100644 --- a/public/components/DiscoverAction/GenerateAnomalyDetector.tsx +++ b/public/components/DiscoverAction/GenerateAnomalyDetector.tsx @@ -99,7 +99,8 @@ function GenerateAnomalyDetector({ const dataSourceId = context.indexPattern?.dataSourceRef?.id; const timeFieldFromIndexPattern = context.indexPattern?.timeFieldName; - const [categoricalFields, dateFields] = context.indexPattern?.fields.reduce( + const fieldsFromContext = context.indexPattern?.fields || []; + const [categoricalFields, dateFields] = fieldsFromContext.reduce( ([cFields, dFields], indexPatternField) => { const esType = indexPatternField.spec.esTypes?.[0]; const name = indexPatternField.spec.name;