# NUMBER field appears as a string in Kibana

**URL:** <https://discuss.elastic.co/t/number-field-appears-as-a-string-in-kibana/89014>\
**Category:** Kibana\
**Created:** [June 12, 2017, 10:26am UTC](https://discuss.elastic.co/t/number-field-appears-as-a-string-in-kibana/89014 "2017-06-12T10:26:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmane](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@nmane](https://discuss.elastic.co/u/nmane)\
**Post date:** [June 12, 2017, 10:26am UTC](https://discuss.elastic.co/t/number-field-appears-as-a-string-in-kibana/89014/1 "2017-06-12T10:26:35Z")

</div>

I am using ELK to parse my logs. I have created a number field `duration` in Logstash.

> %{NUMBER:duration}

I want to find maximum duration. I am using metric in Kibana for the same. But duration field does not appear as a NUMBER field. Kibana shows it as a STRING. Kibana also shows duration as a string in Discover page. Duration is an integer varying from 0 to 177.  
Please help me to understand why this is happening and how I can find maximum duration.

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [June 12, 2017, 4:56pm UTC](https://discuss.elastic.co/t/number-field-appears-as-a-string-in-kibana/89014/2 "2017-06-12T16:56:36Z")

</div>

According to the docs, you should change your formula to `%{NUMBER:duration:int}` (or float) to store it as a number type.

> By default all semantics are saved as strings. If you wish to convert a semantic’s data type, for example change a string to an integer then suffix it with the target data type. For example %{NUMBER:num:int} which converts the num semantic from a string to an integer. Currently the only supported conversions are int and float.

from [Grok filter plugin | Logstash Reference [8.11] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html#_grok_basics)

---

<div class="post-metadata">

**Author:** ![nmane](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@nmane](https://discuss.elastic.co/u/nmane)\
**Post date:** [June 13, 2017, 4:16am UTC](https://discuss.elastic.co/t/number-field-appears-as-a-string-in-kibana/89014/3 "2017-06-13T04:16:04Z")

</div>

I made the changes and it worked. Thank 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 11, 2017, 4:16am UTC](https://discuss.elastic.co/t/number-field-appears-as-a-string-in-kibana/89014/4 "2017-07-11T04:16:08Z")

</div>

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