diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.ts b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.ts index e3d0cec1a6939..1d35a9fd28e61 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.ts +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/get_interval_and_timefield.ts @@ -19,7 +19,9 @@ export function getIntervalAndTimefield( (series.override_index_pattern ? series.series_time_field : panel.time_field) || index.indexPattern?.timeFieldName; - validateField(timeField!, index); + if (panel.use_kibana_indexes) { + validateField(timeField!, index); + } let interval = panel.interval; let maxBars = panel.max_bars; diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/date_histogram.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/date_histogram.js index 48b35d0db5086..bfb3e0f218460 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/date_histogram.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/date_histogram.js @@ -27,7 +27,9 @@ export function dateHistogram( const barTargetUiSettings = await uiSettings.get(UI_SETTINGS.HISTOGRAM_BAR_TARGET); const timeField = annotation.time_field || annotationIndex.indexPattern?.timeFieldName || ''; - validateField(timeField, annotationIndex); + if (panel.use_kibana_indexes) { + validateField(timeField, annotationIndex); + } const { bucketSize, intervalString } = getBucketSize( req, diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/query.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/query.js index 3be567dfe1f40..fcad23b9170a7 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/query.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/query.js @@ -24,7 +24,9 @@ export function query( const barTargetUiSettings = await uiSettings.get(UI_SETTINGS.HISTOGRAM_BAR_TARGET); const timeField = (annotation.time_field || annotationIndex.indexPattern?.timeFieldName) ?? ''; - validateField(timeField, annotationIndex); + if (panel.use_kibana_indexes) { + validateField(timeField, annotationIndex); + } const { bucketSize } = getBucketSize(req, 'auto', capabilities, barTargetUiSettings); const { from, to } = getTimerange(req); diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/top_hits.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/top_hits.js index 447cfdbc8c6e4..b85eb39c18ba6 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/top_hits.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/annotations/top_hits.js @@ -14,7 +14,9 @@ export function topHits(req, panel, annotation, esQueryConfig, annotationIndex) const fields = (annotation.fields && annotation.fields.split(/[,\s]+/)) || []; const timeField = annotation.time_field || annotationIndex.indexPattern?.timeFieldName || ''; - validateField(timeField, annotationIndex); + if (panel.use_kibana_indexes) { + validateField(timeField, annotationIndex); + } overwrite(doc, `aggs.${annotation.id}.aggs.hits.top_hits`, { sort: [ diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js index 41ed472c31936..29cf3f274dc24 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/series/date_histogram.js @@ -67,7 +67,7 @@ export function dateHistogram( intervalString, bucketSize, seriesId: series.id, - index: seriesIndex.indexPattern?.id, + index: panel.use_kibana_indexes ? seriesIndex.indexPattern?.id : undefined, }); return next(doc); diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.js index 4840e625383ca..f0989cf0fa08b 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/request_processors/table/date_histogram.js @@ -23,7 +23,7 @@ export function dateHistogram(req, panel, esQueryConfig, seriesIndex, capabiliti const meta = { timeField, - index: seriesIndex.indexPattern?.id, + index: panel.use_kibana_indexes ? seriesIndex.indexPattern?.id : undefined, }; const getDateHistogramForLastBucketMode = () => {