# Kibana show field as string in "Table" view and as number in "JSON" view

**URL:** <https://discuss.elastic.co/t/kibana-show-field-as-string-in-table-view-and-as-number-in-json-view/230586>\
**Category:** Kibana\
**Created:** [April 30, 2020, 3:30pm UTC](https://discuss.elastic.co/t/kibana-show-field-as-string-in-table-view-and-as-number-in-json-view/230586 "2020-04-30T15:30:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![111320](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111320/32/66612_2.png) [@111320](https://discuss.elastic.co/u/111320)\
**Post date:** [April 30, 2020, 3:30pm UTC](https://discuss.elastic.co/t/kibana-show-field-as-string-in-table-view-and-as-number-in-json-view/230586/1 "2020-04-30T15:30:19Z")

</div>

I parse my log with grok. Some fields parsed to number with the grok format `{BASE10NUM:DB_time:int}`.  
When I look on the data in Kibana (version 7.6) I see something that looks like bug.  
In "Table" view the DB\_time field is string:

![table view](https://us1.discourse-cdn.com/elastic/original/3X/0/0/00953d3ac0b63d72d163983f5781ca5867350e8c.png)  
While in the "JSON" view is a number:

![json view](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e53cdecd3d6a5e5a46ca583f6b9a38a6812a406.jpeg)

Is it a bug in Kibana or maybe I missed something?

---

<div class="post-metadata">

**Author:** ![111320](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111320/32/66612_2.png) [@111320](https://discuss.elastic.co/u/111320)\
**Post date:** [May 3, 2020, 6:01am UTC](https://discuss.elastic.co/t/kibana-show-field-as-string-in-table-view-and-as-number-in-json-view/230586/2 "2020-05-03T06:01:59Z")

</div>

Anyone else saw such issue?  
Should I report about bug on Kibana's github?

---

<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:** [May 3, 2020, 5:38pm UTC](https://discuss.elastic.co/t/kibana-show-field-as-string-in-table-view-and-as-number-in-json-view/230586/3 "2020-05-03T17:38:07Z")

</div>

It's not a bug.you need to define your field as number.

---

<div class="post-metadata">

**Author:** ![111320](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111320/32/66612_2.png) [@111320](https://discuss.elastic.co/u/111320)\
**Post date:** [May 3, 2020, 5:41pm UTC](https://discuss.elastic.co/t/kibana-show-field-as-string-in-table-view-and-as-number-in-json-view/230586/4 "2020-05-03T17:41:52Z")

</div>

As I wrote, I defined it in grok to make it number "int". And it is actually number and I can see it in the JSON view as you can see in my first post. The problem is that it is presented as string in Table view.  
In addition, Kibana don't give me this field in the list of all fields from type number when I'm trying to build visualization.

---

<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:** [May 3, 2020, 9:11pm UTC](https://discuss.elastic.co/t/kibana-show-field-as-string-in-table-view-and-as-number-in-json-view/230586/5 "2020-05-03T21:11:52Z")

</div>

Does it show as text/keyword or number in the index template? Kibana reads from there, so if it got set as text, that's how Kibana will use it. Did you use the grok filter in Logstash or the file upload to parse your log file?

---

<div class="post-metadata">

**Author:** ![111320](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111320/32/66612_2.png) [@111320](https://discuss.elastic.co/u/111320)\
**Post date:** [May 3, 2020, 9:24pm UTC](https://discuss.elastic.co/t/kibana-show-field-as-string-in-table-view-and-as-number-in-json-view/230586/6 "2020-05-03T21:24:28Z")

</div>

> [@Marius\_Dragomir](#):
>
> index template

You are right!!!  
The index pattern show these fields as text. This was the root cause of this strange behavior.  
The reason that the index pattern show it as text is because I created the pattern before I fixed the parser to parse the fields as number.  
I deleted the pattern and create new one and now it works correctly.  
Thank you very much!

---

<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:** [May 31, 2020, 9:24pm UTC](https://discuss.elastic.co/t/kibana-show-field-as-string-in-table-view-and-as-number-in-json-view/230586/7 "2020-05-31T21:24:32Z")

</div>

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