Skip to content

Commit

Permalink
Fixed aggs parsing error (#99159) (#99416)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
igoristic and kibanamachine authored May 12, 2021
1 parent bf15564 commit 64ba8cc
Showing 1 changed file with 23 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,36 +68,32 @@ export async function fetchIndexShardSize(
size,
},
aggs: {
over_threshold: {
index: {
terms: {
field: 'index_stats.index',
size,
},
aggs: {
index: {
terms: {
field: 'index_stats.index',
size,
},
aggs: {
hits: {
top_hits: {
sort: [
{
timestamp: {
order: 'desc' as const,
unmapped_type: 'long' as const,
},
},
],
_source: {
includes: [
'_index',
'index_stats.shards.primaries',
'index_stats.primaries.store.size_in_bytes',
'source_node.name',
'source_node.uuid',
],
hits: {
top_hits: {
sort: [
{
timestamp: {
order: 'desc' as const,
unmapped_type: 'long' as const,
},
size: 1,
},
],
_source: {
includes: [
'_index',
'index_stats.shards.primaries',
'index_stats.primaries.store.size_in_bytes',
'source_node.name',
'source_node.uuid',
],
},
size: 1,
},
},
},
Expand All @@ -118,7 +114,7 @@ export async function fetchIndexShardSize(
const validIndexPatterns = memoizedIndexPatterns(shardIndexPatterns);
const thresholdBytes = threshold * gbMultiplier;
for (const clusterBucket of clusterBuckets) {
const indexBuckets = clusterBucket.over_threshold.index.buckets;
const indexBuckets = clusterBucket.index.buckets;
const clusterUuid = clusterBucket.key;

for (const indexBucket of indexBuckets) {
Expand Down

0 comments on commit 64ba8cc

Please sign in to comment.