# Cannot use percentile aggregation on custom double field

**URL:** <https://discuss.elastic.co/t/cannot-use-percentile-aggregation-on-custom-double-field/222940>\
**Category:** Kibana\
**Created:** [March 10, 2020, 1:18pm UTC](https://discuss.elastic.co/t/cannot-use-percentile-aggregation-on-custom-double-field/222940 "2020-03-10T13:18:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack\_Phan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_phan/32/44738_2.png) [@Jack\_Phan](https://discuss.elastic.co/u/Jack_Phan)\
**Post date:** [March 10, 2020, 1:18pm UTC](https://discuss.elastic.co/t/cannot-use-percentile-aggregation-on-custom-double-field/222940/1 "2020-03-10T13:18:21Z")

</div>

I added **$request\_time** field to my Nginx access log without update the default mapping and used **%{NUMBER:http.response.time:double}** in Grok to parse it. I can use **percentiles** aggregation in DevTools on this field:

 ![Screen Shot 2020-03-10 at 8.09.16 PM](https://us1.discourse-cdn.com/elastic/original/3X/e/4/e4d8268bf766e2831304b68a13c21ed82a823726.png)  
However, in bar chart visualization, I cannot use Range or Percentile in this field. I changed the aggregation to Term and figured out the Kibana see this field as String.

In addition, when I used TSVB, I still could apply Percentile on this field and now Kibana sees it as a number:

 ![Screen Shot 2020-03-10 at 8.17.11 PM](https://us1.discourse-cdn.com/elastic/original/3X/4/7/479411a4b383732ac7f2cb0924a83653d3d4bec7.png)

Does anybody know why I cannot use it with Percentile aggregation in Bar chart?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [March 13, 2020, 12:34am UTC](https://discuss.elastic.co/t/cannot-use-percentile-aggregation-on-custom-double-field/222940/2 "2020-03-13T00:34:16Z")

</div>

Can you check the mapping and post it here? Kibana shouldn't really see a field as string if it's a numeric field in the mapping.

---

<div class="post-metadata">

**Author:** ![Jack\_Phan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_phan/32/44738_2.png) [@Jack\_Phan](https://discuss.elastic.co/u/Jack_Phan)\
**Post date:** [March 13, 2020, 1:14am UTC](https://discuss.elastic.co/t/cannot-use-percentile-aggregation-on-custom-double-field/222940/3 "2020-03-13T01:14:05Z")

</div>

@Marius_Dragomir

I figured out that the currently supported number types for Grok are **int** and **float**. That's why when I used **%{NUMBER:http.response.time:double}** to parse the field, it got some problems at some points.  
I changed the pattern to **%{NUMBER:http.response.time:float}** and it worked fine now.

Anyway, thank you very much for your response.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [March 13, 2020, 12:21pm UTC](https://discuss.elastic.co/t/cannot-use-percentile-aggregation-on-custom-double-field/222940/4 "2020-03-13T12:21:45Z")

</div>

Glad you got it all sorted out.

---

<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:** [April 10, 2020, 12:21pm UTC](https://discuss.elastic.co/t/cannot-use-percentile-aggregation-on-custom-double-field/222940/5 "2020-04-10T12:21:49Z")

</div>

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