diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 869160bfa0fd1..215514d58f601 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -415,6 +415,7 @@
/x-pack/plugins/security_solution/cypress/integration/urls @elastic/security-threat-hunting-investigations
/x-pack/plugins/security_solution/public/common/components/alerts_viewer @elastic/security-threat-hunting-investigations
+/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_action @elastic/security-threat-hunting-investigations
/x-pack/plugins/security_solution/public/common/components/event_details @elastic/security-threat-hunting-investigations
/x-pack/plugins/security_solution/public/common/components/events_viewer @elastic/security-threat-hunting-investigations
/x-pack/plugins/security_solution/public/common/components/markdown_editor @elastic/security-threat-hunting-investigations
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/use_saved_search.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/use_saved_search.ts
index c4611a1740913..0a75c6467f9d0 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/use_saved_search.ts
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/use_saved_search.ts
@@ -7,12 +7,12 @@
import { useState, useEffect } from 'react';
import {
+ buildEsQuery,
+ buildQueryFromFilters,
decorateQuery,
fromKueryExpression,
- luceneStringToDsl,
toElasticsearchQuery,
} from '@kbn/es-query';
-import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { useMlContext } from '../../../../../contexts/ml';
import { SEARCH_QUERY_LANGUAGE } from '../../../../../../../common/constants/search';
import { getQueryFromSavedSearchObject } from '../../../../../util/index_utils';
@@ -36,19 +36,42 @@ export function useSavedSearch() {
const { currentSavedSearch, currentDataView, kibanaConfig } = mlContext;
const getQueryData = () => {
- let qry: estypes.QueryDslQueryContainer = {};
+ let qry: any = {};
let qryString;
if (currentSavedSearch !== null) {
- const { query } = getQueryFromSavedSearchObject(currentSavedSearch);
+ const { query, filter } = getQueryFromSavedSearchObject(currentSavedSearch);
const queryLanguage = query.language;
qryString = query.query;
if (queryLanguage === SEARCH_QUERY_LANGUAGE.KUERY) {
const ast = fromKueryExpression(qryString);
qry = toElasticsearchQuery(ast, currentDataView);
+ const filterQuery = buildQueryFromFilters(filter, currentDataView);
+ if (qry.bool === undefined) {
+ qry.bool = {};
+ // toElasticsearchQuery may add a single match_all item to the
+ // root of its returned query, rather than putting it inside
+ // a bool.should
+ // in this case, move it to a bool.should
+ if (qry.match_all !== undefined) {
+ qry.bool.should = {
+ match_all: qry.match_all,
+ };
+ delete qry.match_all;
+ }
+ }
+
+ if (Array.isArray(qry.bool.filter) === false) {
+ qry.bool.filter = qry.bool.filter === undefined ? [] : [qry.bool.filter];
+ }
+ if (Array.isArray(qry.bool.must_not) === false) {
+ qry.bool.must_not = qry.bool.must_not === undefined ? [] : [qry.bool.must_not];
+ }
+ qry.bool.filter = [...qry.bool.filter, ...filterQuery.filter];
+ qry.bool.must_not = [...qry.bool.must_not, ...filterQuery.must_not];
} else {
- qry = luceneStringToDsl(qryString);
+ qry = buildEsQuery(currentDataView, [query], filter);
decorateQuery(qry, kibanaConfig.get('query:queryString:options'));
}
diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/page.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/page.tsx
index c35ad5bacf371..524556e12a9af 100644
--- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/page.tsx
+++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/page.tsx
@@ -108,7 +108,7 @@ export const Page: FC<{
/>
) : null}
{jobIdToUse !== undefined && (
-
Have you set up monitoring yet? If so, make sure that the selected time period in the upper right includes monitoring data.
+ If you have configured monitoring data to be sent to a dedicated monitoring cluster you should access that data with the Kibana instance attached to the monitoring cluster.
+
+ If you have configured monitoring data to be sent to a dedicated monitoring cluster you should access that data with the Kibana instance attached to the monitoring cluster.
+
+