Skip to content

Commit 3f015e1

Browse files
Fix inconsistent total count on TopN events panel (#111256)
We can't display `response.totalCount` because it is the total number of events the query returns. It doesn't take into account the aggregation. It does include events with missing `stackedByField` and events that are not included in the 10 top. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
1 parent 1a1ae6c commit 3f015e1

File tree

1 file changed

+1
-1
lines changed
  • x-pack/plugins/security_solution/public/common/containers/matrix_histogram

1 file changed

+1
-1
lines changed

x-pack/plugins/security_solution/public/common/containers/matrix_histogram/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export const useMatrixHistogram = ({
141141
data: response.matrixHistogramData,
142142
inspect: getInspectResponse(response, prevResponse.inspect),
143143
refetch: refetch.current,
144-
totalCount: response.totalCount,
144+
totalCount: histogramBuckets.reduce((acc, bucket) => bucket.doc_count + acc, 0),
145145
buckets: histogramBuckets,
146146
}));
147147
searchSubscription$.current.unsubscribe();

0 commit comments

Comments
 (0)