# Bucket Aggregate not working in newer versions

**URL:** https://discuss.elastic.co/t/bucket-aggregate-not-working-in-newer-versions/307591
**Category:** Kibana
**Tags:** painless
**Created:** [June 19, 2022, 10:04pm UTC](https://discuss.elastic.co/t/bucket-aggregate-not-working-in-newer-versions/307591 "2022-06-19T22:04:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ankita\_Pachauri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankita_pachauri/32/61469_2.png) [@Ankita\_Pachauri](https://discuss.elastic.co/u/Ankita_Pachauri)
#### Post date: [June 19, 2022, 10:04pm UTC](https://discuss.elastic.co/t/bucket-aggregate-not-working-in-newer-versions/307591/1 "2022-06-19T22:04:19Z")

</div>

Hi team,  
Previously I had a visualisation for top 10 VMS showing the cou usage of the infrastructure. The concept behind the visualisation was:

- The data was collected from metricbeat
- Average of system.cpu.user.pct, system.cpu.system.pct, system.cpu.cores was calculated and then each average was stored in 3 different variables. Using painless script in bucket aggregation user.pct was added to system.pct and divided by cores.

We found after the upgrade has been done, the values are showing hyphen instead of values.

Please suggest some workaround.

---

<div class="post-metadata">

### Author: ![Jugsofbeer](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@Jugsofbeer](https://discuss.elastic.co/u/Jugsofbeer)
#### Post date: [June 19, 2022, 10:29pm UTC](https://discuss.elastic.co/t/bucket-aggregate-not-working-in-newer-versions/307591/2 "2022-06-19T22:29:02Z")

</div>

Hi,

Is your metricbeat agent sending in the normalised values?

system.​cpu.​total.​norm.​pct  
system.​cpu.​idle.​norm.​pct  
system.​cpu.​iowait.​norm.​pct  
system.​cpu.​irq.​norm.​pct  
system.​cpu.​nice.​norm.​pct  
system.​cpu.​softirq.​norm.​pct  
system.​cpu.​steal.​norm.​pct  
system.​cpu.​system.​norm.​pct  
system.​cpu.​user.​norm.​pct

> **[System fields | Metricbeat Reference \[8.2\] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-system.html)**

**`system.cpu.cores`**

The number of CPU cores present on the host. The non-normalized percentages will have a maximum value of `100% * cores`. The normalized percentages already take this value into account and have a maximum value of 100%.

---

<div class="post-metadata">

### Author: ![Ankita\_Pachauri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankita_pachauri/32/61469_2.png) [@Ankita\_Pachauri](https://discuss.elastic.co/u/Ankita_Pachauri)
#### Post date: [June 27, 2022, 5:35pm UTC](https://discuss.elastic.co/t/bucket-aggregate-not-working-in-newer-versions/307591/3 "2022-06-27T17:35:30Z")

</div>

Hi,  
I don't have any normalized fields in my data.  
Apologies for the delay in response.

---

<div class="post-metadata">

### Author: ![Jugsofbeer](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@Jugsofbeer](https://discuss.elastic.co/u/Jugsofbeer)
#### Post date: [June 28, 2022, 2:39am UTC](https://discuss.elastic.co/t/bucket-aggregate-not-working-in-newer-versions/307591/4 "2022-06-28T02:39:46Z")

</div>

Update your metricbeat system configuration to

cpu.metrics: ["percentages","normalized\_percentages"]

per the documentation and you will get both the raw percentages and the calculated/normalized percentage which does the division by number of cores for you.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 26, 2022, 2:40am UTC](https://discuss.elastic.co/t/bucket-aggregate-not-working-in-newer-versions/307591/5 "2022-07-26T02:40:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
