Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { useSelectDataView } from '../../hooks/use_select_data_view';
import { DataViewManagerScopeName } from '../../constants';
import { useManagedDataViews } from '../../hooks/use_managed_data_views';
import { useSavedDataViews } from '../../hooks/use_saved_data_views';
import { DEFAULT_SECURITY_DATA_VIEW, LOADING } from './translations';
import { LOADING } from './translations';
import { DATA_VIEW_PICKER_TEST_ID } from './constants';

interface DataViewPickerProps {
Expand Down Expand Up @@ -154,16 +154,10 @@ export const DataViewPicker = memo(({ scope, onClosePopover, disabled }: DataVie
return { label: LOADING };
}

if (dataViewSpec.id === defaultDataViewId) {
return {
label: DEFAULT_SECURITY_DATA_VIEW,
};
}

return {
label: dataViewSpec?.name || dataViewSpec?.id || 'Data view',
};
}, [dataViewSpec.id, dataViewSpec?.name, defaultDataViewId, status]);
}, [dataViewSpec?.name, dataViewSpec?.id, status]);

return (
<div data-test-subj={DATA_VIEW_PICKER_TEST_ID}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import { transformError } from '@kbn/securitysolution-es-utils';
import { ensurePatternFormat } from '../../../common/utils/sourcerer';
import type { KibanaDataView } from '../store/model';
import { DEFAULT_TIME_FIELD } from '../../../common/constants';
import { DEFAULT_SECURITY_ALERT_DATA_VIEW } from '../../data_view_manager/components/data_view_picker/translations';
import {
DEFAULT_SECURITY_DATA_VIEW,
DEFAULT_SECURITY_ALERT_DATA_VIEW,
} from '../../data_view_manager/components/data_view_picker/translations';

export interface GetSourcererDataView {
signal?: AbortSignal;
Expand Down Expand Up @@ -59,6 +62,7 @@ export const createSourcererDataView = async ({
id: dataViewId,
title: patternListAsTitle,
timeFieldName: DEFAULT_TIME_FIELD,
name: DEFAULT_SECURITY_DATA_VIEW,
},
// Override property - if a data view exists with the security solution pattern
// delete it and replace it with our data view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@

export const AGENTLESS_SECURITY_POSTURE_PACKAGE_VERSION = '1.13.0-preview02';
export const SECURITY_ES_ARCHIVES_DIR = 'x-pack/test/security_solution_cypress/es_archives';
export const SECURITY_SOLUTION_DATA_VIEW =
export const SECURITY_SOLUTION_DATA_VIEW = 'Default security data view';
export const SECURITY_SOLUTION_INDEX_PATTERN =
'.alerts-security.alerts-default,apm-*-transaction*,auditbeat-*,endgame-*,filebeat-*,logs-*,packetbeat-*,traces-apm*,winlogbeat-*,-*elastic-cloud-logs-*';
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import expect from '@kbn/expect';
import { ServerlessRoleName } from '../../../../../../shared/lib';
import { FtrProviderContext } from '../../../../../ftr_provider_context';
import { getDiscoverESQLState } from './utils';
import { SECURITY_SOLUTION_DATA_VIEW } from '../../../constants';
import { SECURITY_SOLUTION_DATA_VIEW, SECURITY_SOLUTION_INDEX_PATTERN } from '../../../constants';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'timePicker', 'discover', 'svlCommonPage']);
Expand All @@ -27,7 +27,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('ES|QL mode', () => {
it('should render alert workflow status badge', async () => {
const state = getDiscoverESQLState(
`from ${SECURITY_SOLUTION_DATA_VIEW} | WHERE host.name == "siem-kibana" and event.kind != "signal"`
`from ${SECURITY_SOLUTION_INDEX_PATTERN} | WHERE host.name == "siem-kibana" and event.kind != "signal"`
);
await PageObjects.common.navigateToActualUrl('discover', `?_a=${state}`, {
ensureCurrentUrl: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
*/

import kbnRison from '@kbn/rison';
import { SECURITY_SOLUTION_DATA_VIEW } from '../../../constants';
import { SECURITY_SOLUTION_INDEX_PATTERN } from '../../../constants';

export const getDiscoverESQLState = (query?: string) => {
return kbnRison.encode({
dataSource: { type: 'esql' },
query: {
esql: query ?? `FROM ${SECURITY_SOLUTION_DATA_VIEW} | WHERE host.name == "siem-kibana"`,
esql: query ?? `FROM ${SECURITY_SOLUTION_INDEX_PATTERN} | WHERE host.name == "siem-kibana"`,
},
});
};