Skip to content

Commit

Permalink
fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykkopycinski committed Aug 31, 2020
1 parent 78f0897 commit ae3df02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '../../../../../../common/search_strategy/security_solution/network';

export const getHttpEdges = (response: IEsSearchResponse<unknown>): NetworkHttpEdges[] =>
formatHttpEdges(getOr([], `aggregations.url.buckets`, response));
formatHttpEdges(getOr([], `aggregations.url.buckets`, response.rawResponse));

const formatHttpEdges = (buckets: NetworkHttpBuckets[]): NetworkHttpEdges[] =>
buckets.map((bucket: NetworkHttpBuckets) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const networkHttp: SecuritySolutionFactory<NetworkQueries.http> = {
response: IEsSearchResponse<unknown>
): Promise<NetworkHttpStrategyResponse> => {
const { activePage, cursorStart, fakePossibleCount, querySize } = options.pagination;
const totalCount = getOr(0, 'aggregations.count.value', response.rawResponse);
const totalCount = getOr(0, 'aggregations.http_count.value', response.rawResponse);
const networkHttpEdges: NetworkHttpEdges[] = getHttpEdges(response);
const fakeTotalCount = fakePossibleCount <= totalCount ? fakePossibleCount : totalCount;
const edges = networkHttpEdges.splice(cursorStart, querySize - cursorStart);
Expand Down

0 comments on commit ae3df02

Please sign in to comment.