# Numeric field (long) shown as string in kibana discovery

**URL:** https://discuss.elastic.co/t/numeric-field-long-shown-as-string-in-kibana-discovery/237656
**Category:** Logstash
**Created:** [June 18, 2020, 2:39pm UTC](https://discuss.elastic.co/t/numeric-field-long-shown-as-string-in-kibana-discovery/237656 "2020-06-18T14:39:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ndg](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@ndg](https://discuss.elastic.co/u/ndg)
#### Post date: [June 18, 2020, 2:39pm UTC](https://discuss.elastic.co/t/numeric-field-long-shown-as-string-in-kibana-discovery/237656/1 "2020-06-18T14:39:14Z")

</div>

Hi! We are installing and testing the ELK stack in a test env in out company.  
I am working towards migrating rsyslog logs from Graylog to ELK.  
But even when some fields are mapped as long in elasticsearch when i go to Kibana Discovery they are shown as string.  
Here is my logstash config:

```auto
 input {
   tcp {
     port => 5141
     type => syslog
   }
 }
 
 filter {
   if [type] == "syslog" {
     grok {
       match => { "message" => '<%{POSINT:syslog_pri}>%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{NOTSPACE:servicio}\_%{NOTSPACE:apache_tipo_log}: %{GREEDYDATA:syslog_message}' }
     }
   }
   grok {
        match => { "syslog_message" => '%{IPORHOST:clientip} %{HTTPDUSER:apache_httpuser} %{USER:apache_user} \[%{HTTPDATE:timestamp_apache}\] "(?:%{WORD:HTTP_method} %{NOTSPACE:request}(?: HTTP/%{NUMBER:http_version})?|%{DATA:rawrequest})" %{NUMBER:response_code} (?:%{NUMBER:bytes:int}|-) %{NUMBER:response_time_sec:int}\/%{NUMBER:response_time_us:int}' }
   }
   mutate {
        convert => {
             "bytes" => "integer"
             "response_time_sec" => "integer"
             "response_time_us" => "integer"
        }
   }
 }
 
 
 #output {
 # stdout { codec => rubydebug }
 #}
 
 output {
   elasticsearch {
    hosts => ["https://ELASTICSERVER:9200"]
         user => "USER"
         password => "USERPASS"
         ssl => true
         cacert => "CERLOCATION"
     manage_template => false
     index => "syslog-%{+YYYY.MM.dd}"
   }
 }

```

At first the info was parsed without any forced type but i changed it as you can see (about 3 days ago)  
I know that if an index have a field mapped as certain type and you change the data to be created as another type then you have to wait until a new index is created or delete the current index and create the new one. With that being said my config creates a new index each day.  
So, even when the data is being created as long i still see the data in discovery as string type.  
This is the json of the last created index as seen from the kibana config -\> elasticsearch -\> index management -\> mappings

```auto
         "response_time_sec": {
           "type": "long"
         },
         "response_time_us": {
           "type": "long"
         },

```

What am i doing wrong?

---

<div class="post-metadata">

### Author: ![ndg](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@ndg](https://discuss.elastic.co/u/ndg)
#### Post date: [June 25, 2020, 2:57pm UTC](https://discuss.elastic.co/t/numeric-field-long-shown-as-string-in-kibana-discovery/237656/2 "2020-06-25T14:57:05Z")

</div>

Does anyone have any idea about this?

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [June 25, 2020, 3:59pm UTC](https://discuss.elastic.co/t/numeric-field-long-shown-as-string-in-kibana-discovery/237656/3 "2020-06-25T15:59:29Z")

</div>

If you are saying that you have rolled to a new index, and the index mapping shows the fields as "long", and kibana still refers to them as strings, then try doing a index refresh in the index pattern management page in kibana.

---

<div class="post-metadata">

### Author: ![ndg](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@ndg](https://discuss.elastic.co/u/ndg)
#### Post date: [June 25, 2020, 4:15pm UTC](https://discuss.elastic.co/t/numeric-field-long-shown-as-string-in-kibana-discovery/237656/4 "2020-06-25T16:15:22Z")

</div>

That did the trick! Thanks! I see it both in the config of the index inside Kibana and in the discovery tab as a number.

---

<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 23, 2020, 4:15pm UTC](https://discuss.elastic.co/t/numeric-field-long-shown-as-string-in-kibana-discovery/237656/5 "2020-07-23T16:15:22Z")

</div>

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