Skip to content

Commit

Permalink
no
Browse files Browse the repository at this point in the history
  • Loading branch information
dplumlee committed Jun 29, 2021
1 parent d3805a6 commit c77026a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const MatrixHistogramComponent: React.FC<MatrixHistogramComponentProps> =
title,
titleSize,
yTickFormatter,
skip,
}) => {
const dispatch = useDispatch();
const handleBrushEnd = useCallback(
Expand Down Expand Up @@ -146,6 +147,7 @@ export const MatrixHistogramComponent: React.FC<MatrixHistogramComponentProps> =
stackByField: selectedStackByOption.value,
isPtrIncluded,
docValueFields,
skip,
};

const [loading, { data, inspect, totalCount, refetch }] = useMatrixHistogramCombined(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const HostDetailsTabs = React.memo<HostDetailsTabsProps>(
deleteQuery,
endDate: to,
filterQuery,
skip: isInitializing,
skip: isInitializing || filterQuery === undefined,
setQuery,
startDate: from,
type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const HostsTabs = memo<HostsTabsProps>(
endDate: to,
filterQuery,
indexNames,
skip: isInitializing,
skip: isInitializing || filterQuery === undefined,
setQuery,
startDate: from,
type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ const EventsByDatasetComponent: React.FC<Props> = ({
setAbsoluteRangeDatePickerTarget={setAbsoluteRangeDatePickerTarget}
setQuery={setQuery}
showSpacer={showSpacer}
skip={filterQuery === undefined}
startDate={from}
timelineId={timelineId}
{...eventsByDatasetHistogramConfigs}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,38 @@ import { useKibana } from '../../../common/lib/kibana';
export const useRequestEventCounts = (to: string, from: string) => {
const { uiSettings } = useKibana().services;

const [filterQuery] = convertToBuildEsQuery({
config: esQuery.getEsQueryConfig(uiSettings),
indexPattern: {
fields: [
{
name: 'event.kind',
aggregatable: true,
searchable: true,
type: 'string',
esTypes: ['keyword'],
},
],
title: 'filebeat-*',
},
queries: [{ query: 'event.type:indicator', language: 'kuery' }],
filters: [],
});

const matrixHistogramRequest = useMemo(() => {
return {
endDate: to,
errorMessage: i18n.translate('xpack.securitySolution.overview.errorFetchingEvents', {
defaultMessage: 'Error fetching events',
}),
filterQuery: convertToBuildEsQuery({
config: esQuery.getEsQueryConfig(uiSettings),
indexPattern: {
fields: [
{
name: 'event.kind',
aggregatable: true,
searchable: true,
type: 'string',
esTypes: ['keyword'],
},
],
title: 'filebeat-*',
},
queries: [{ query: 'event.type:indicator', language: 'kuery' }],
filters: [],
}),
filterQuery,
histogramType: MatrixHistogramType.events,
indexNames: DEFAULT_CTI_SOURCE_INDEX,
stackByField: EVENT_DATASET,
startDate: from,
size: 0,
};
}, [to, from, uiSettings]);
}, [to, from, filterQuery]);

const results = useMatrixHistogram(matrixHistogramRequest);

Expand Down

0 comments on commit c77026a

Please sign in to comment.