# How to format aggregation output in kibana visualization

**URL:** https://discuss.elastic.co/t/how-to-format-aggregation-output-in-kibana-visualization/253769
**Category:** Kibana
**Created:** [October 30, 2020, 2:55am UTC](https://discuss.elastic.co/t/how-to-format-aggregation-output-in-kibana-visualization/253769 "2020-10-30T02:55:41Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Adriann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adriann/32/77780_2.png) [@Adriann](https://discuss.elastic.co/u/Adriann)
#### Post date: [October 30, 2020, 2:55am UTC](https://discuss.elastic.co/t/how-to-format-aggregation-output-in-kibana-visualization/253769/1 "2020-10-30T02:55:41Z")

</div>

I want to format output in Overall Average of Average system.cpu.total.norm.pct to percentage

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/b/5b3e9edae6feab8493b1a81c4be6581b4962ea0f.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0af941a4a948e1ec18b32769a986cc877c819044.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/8/b8ca9823c50d30483c3df21e34208fb66241f931.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/f/9ff3e317374f0f9bad4d90df6ce2a64a95bbbf26.png)

I red that I can use painless script in kibana vizulization creator.

I could now found the proper syntax.

How can I achive that?

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [October 30, 2020, 7:16am UTC](https://discuss.elastic.co/t/how-to-format-aggregation-output-in-kibana-visualization/253769/2 "2020-10-30T07:16:05Z")

</div>

How do you want to format it? If you just want to show the way the number is shown, you can probably achieve this by setting the formatter of the `system.cou.total.norm.pct` in your index pattern: [https://www.elastic.co/guide/en/kibana/current/field-formatters-numeric.html](https://www.elastic.co/guide/en/kibana/current/field-formatters-numeric.html)

---

<div class="post-metadata">

### Author: ![Adriann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adriann/32/77780_2.png) [@Adriann](https://discuss.elastic.co/u/Adriann)
#### Post date: [October 30, 2020, 9:20am UTC](https://discuss.elastic.co/t/how-to-format-aggregation-output-in-kibana-visualization/253769/3 "2020-10-30T09:20:28Z")

</div>

I checked and this field is already filtred as percentage.

But I cannot make It work as I wont in Kibana.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/c/ec4fcc5840110b4e5a07760824bf42277f4150e6.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/9/f95586e7102684182c176abc3f679cf5f0cd3dd3.png)

How to get ride of not percentage field?

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [October 30, 2020, 11:05am UTC](https://discuss.elastic.co/t/how-to-format-aggregation-output-in-kibana-visualization/253769/4 "2020-10-30T11:05:04Z")

</div>

That's not the right place to configure it - you have to go to Management \> Index pattern \> Select field \> format ([https://www.elastic.co/guide/en/kibana/current/managing-fields.html](https://www.elastic.co/guide/en/kibana/current/managing-fields.html))

---

<div class="post-metadata">

### Author: ![Adriann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adriann/32/77780_2.png) [@Adriann](https://discuss.elastic.co/u/Adriann)
#### Post date: [October 30, 2020, 11:35am UTC](https://discuss.elastic.co/t/how-to-format-aggregation-output-in-kibana-visualization/253769/5 "2020-10-30T11:35:39Z")

</div>

I have check that before and It is already formatted as a percentage

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/1/614be7b8a4d0d2280cb5664ee668de78a50baaa4.png)

---

<div class="post-metadata">

### Author: ![Adriann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adriann/32/77780_2.png) [@Adriann](https://discuss.elastic.co/u/Adriann)
#### Post date: [October 30, 2020, 11:59am UTC](https://discuss.elastic.co/t/how-to-format-aggregation-output-in-kibana-visualization/253769/6 "2020-10-30T11:59:37Z")

</div>

After some research, I guess It does not work because of [this](https://github.com/elastic/kibana/issues/15875)

> We're actually nowadays using the default index pattern in the selection by default instead of `*` . Nevertheless it would be nice if you could have an autocompletion on existing index patterns (you should still be able to type anything else you want).

In my default index filebeat\* I do not have this formaterand field.

I don't want to change the default index how can I format this field using a painless script?

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [October 30, 2020, 12:32pm UTC](https://discuss.elastic.co/t/how-to-format-aggregation-output-in-kibana-visualization/253769/7 "2020-10-30T12:32:30Z")

</div>

The format you specify in the index pattern only takes effect if you use that index pattern as the source for your visualization.

> I don't want to change the default index how can I format this field using a painless script?

I see two options:

- You can create a separate index pattern matching the same data indices (e.g. `filebea*`), change the format there and build your visualization using that separate index pattern.
- You can create a scripted field that does nothing but returning the `system.cou.total.norm.pct` value. Then you can specify the percentage formatter for this scripted field.

---

<div class="post-metadata">

### Author: ![Adriann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/adriann/32/77780_2.png) [@Adriann](https://discuss.elastic.co/u/Adriann)
#### Post date: [October 30, 2020, 1:44pm UTC](https://discuss.elastic.co/t/how-to-format-aggregation-output-in-kibana-visualization/253769/9 "2020-10-30T13:44:04Z")

</div>

I changed the default index pattern to \* and now it works

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/6/663fad665fc7ce04b3317bc7b9ae2330223c152d.png)

![image](https://us1.discourse-cdn.com/elastic/original/3X/4/b/4b5070460b3b951af1a8e4401a8eb52951927234.png)

---

<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: [November 27, 2020, 1:44pm UTC](https://discuss.elastic.co/t/how-to-format-aggregation-output-in-kibana-visualization/253769/10 "2020-11-27T13:44:08Z")

</div>

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