# Some field show NaN and errors

**URL:** <https://community.graylog.org/t/some-field-show-nan-and-errors/11862>\
**Category:** Graylog Central (peer support)\
**Created:** [September 6, 2019, 12:06pm UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862 "2019-09-06T12:06:27Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uporaba](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/uporaba/32/11232_2.png) [@Uporaba](https://community.graylog.org/u/Uporaba)\
**Post date:** [September 6, 2019, 12:06pm UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/1 "2019-09-06T12:06:27Z")

</div>

Some data is not displayed. How can one determine why? How can i fix this?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/3/37c9371a020fae863d81c5b763d47ba15badca33.png)  
I still have some problems. why do they arise?  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/4/4c8c9ec36ea3685f0501c68272c29307787c71d1.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/f/f2d5e65106a95048b1e19bff563629a773df8484.png)  
i Tryed it [Some statistics still NaN?](https://community.graylog.org/t/some-statistics-still-nan/5636/8) but is didnt work (  
But if i use `curl -X GET 'http://localhost:9200/graylog_deflector/_mapping?pretty` it is displayed:

```
{
  "graylog_113" : {
    "mappings" : {
      "message" : {
        "dynamic_templates" : [
          {
            "internal_fields" : {
              "match" : "gl2_*",
              "mapping" : {
                "type" : "keyword"
              }
            }
          },
          {
            "store_generic" : {
              "match_mapping_type" : "string",
              "mapping" : {
                "type" : "keyword"
              }
            }
          }
        ],
        "properties" : {
          "Output" : {
            "type" : "keyword"
          },
          "RC" : {
            "type" : "keyword"
          },
          "Results" : {
            "type" : "keyword"
          },
          "Source" : {
            "type" : "keyword"
          },
          "access_token" : {
            "type" : "keyword"
          },
          "agreementnumber" : {
            "type" : "keyword"
          },
          "api_errorcode" : {
            "type" : "keyword"
          },
          "apiname" : {
            "type" : "keyword"
          },
          "apistatus" : {
            "type" : "keyword"
          },
          "args" : {
            "type" : "keyword"
          },
          "body_bytes_sent" : {
            "type" : "long"
          },
          "city" : {
            "type" : "keyword"
          },
          "city_domain" : {
            "type" : "keyword"
          },
          "citydomain" : {
            "type" : "keyword"
          },
          "client_mac" : {
            "type" : "keyword"
          },
          "container_id" : {
            "type" : "keyword"
          },
          "facility" : {
            "type" : "keyword"
          },
          "from_nginx" : {
            "type" : "keyword"
          },
          "full_message" : {
            "type" : "text",
            "analyzer" : "standard"
          },
          "gl2_remote_ip" : {
            "type" : "keyword"
          },
          "gl2_remote_port" : {
            "type" : "keyword"
          },
          "gl2_source_input" : {
            "type" : "keyword"
          },
          "gl2_source_node" : {
            "type" : "keyword"
          },
          "host" : {
            "type" : "keyword"
          },
          "http_referrer" : {
            "type" : "keyword"
          },
          "http_status" : {
            "type" : "keyword"
          },
          "http_user_agent" : {
            "type" : "keyword"
          },
          "http_x_forwarded_for" : {
            "type" : "keyword"
          },
          "json" : {
            "type" : "keyword"
          },
          "lb-fqdn" : {
            "type" : "keyword"
          },
          "level" : {
            "type" : "long"
          },
          "message" : {
            "type" : "text",
            "analyzer" : "standard"
          },
          "nas_ip" : {
            "type" : "keyword"
          },
          "nginx_access" : {
            "type" : "keyword"
          },
          "nginx_error" : {
            "type" : "keyword"
          },
          "oauthclient" : {
            "type" : "keyword"
          },
          "pkg" : {
            "type" : "keyword"
          },
          "platform" : {
            "type" : "keyword"
          },
          "port_index" : {
            "type" : "keyword"
          },
          "remote_addr" : {
            "type" : "keyword"
          },
          "request" : {
            "type" : "keyword"
          },
          "request_id" : {
            "type" : "keyword"
          },
          "request_method" : {
            "type" : "keyword"
          },
          "request_time" : {
            "type" : "float"
          },
          "response_status" : {
            "type" : "long"
          },
          "response_time" : {
            "type" : "keyword"
          },
          "response_time_nums" : {
            "type" : "float"
          },
          "server" : {
            "type" : "keyword"
          },
          "source" : {
            "type" : "text",
            "analyzer" : "analyzer_keyword",
            "fielddata" : true
          },
          "streams" : {
            "type" : "keyword"
          },
          "switch_ip" : {
            "type" : "keyword"
          },
          "switch_mac" : {
            "type" : "keyword"
          },
          "switch_port" : {
            "type" : "keyword"
          },
          "system" : {
            "type" : "keyword"
          },
          "time_to_live" : {
            "type" : "keyword"
          },
          "timestamp" : {
            "type" : "date",
            "format" : "yyyy-MM-dd HH:mm:ss.SSS"
          },
          "upstream_addr" : {
            "type" : "keyword"
          },
          "upstream_cache_status" : {
            "type" : "keyword"
          },
          "upstream_connect_time" : {
            "type" : "keyword"
          },
          "upstream_header_time" : {
            "type" : "keyword"
          },
          "upstream_response_time" : {
            "type" : "keyword"
          },
          "url_without_param" : {
            "type" : "keyword"
          },
          "user_agent" : {
            "type" : "keyword"
          },
          "value" : {
            "type" : "keyword"
          },
          "x-project" : {
            "type" : "keyword"
          },
          "x_forwarded_for" : {
            "type" : "keyword"
          },
          "x_real_ip" : {
            "type" : "keyword"
          },
          "x_real_ipv6" : {
            "type" : "keyword"
          },
          "x_request_id" : {
            "type" : "keyword"
          }
        }
      }
    }
  }
}
{
  "graylog_113" : {
    "mappings" : {
      "message" : {
        "dynamic_templates" : [
          {
            "internal_fields" : {
              "match" : "gl2_*",
              "mapping" : {
                "type" : "keyword"
              }
            }
          },
          {
            "store_generic" : {
              "match_mapping_type" : "string",
              "mapping" : {
                "type" : "keyword"
              }
            }
          }
        ],
        "properties" : {
          "Output" : {
            "type" : "keyword"
          },
          "RC" : {
            "type" : "keyword"
          },
          "Results" : {
            "type" : "keyword"
          },
          "Source" : {
            "type" : "keyword"
          },
          "access_token" : {
            "type" : "keyword"
          },
          "agreementnumber" : {
            "type" : "keyword"
          },
          "api_errorcode" : {
            "type" : "keyword"
          },
          "apiname" : {
            "type" : "keyword"
          },
          "apistatus" : {
            "type" : "keyword"
          },
          "args" : {
            "type" : "keyword"
          },
          "body_bytes_sent" : {
            "type" : "long"
          },
          "city" : {
            "type" : "keyword"
          },
          "city_domain" : {
            "type" : "keyword"
          },
          "citydomain" : {
            "type" : "keyword"
          },
          "client_mac" : {
            "type" : "keyword"
          },
          "container_id" : {
            "type" : "keyword"
          },
          "facility" : {
            "type" : "keyword"
          },
          "from_nginx" : {
            "type" : "keyword"
          },
          "full_message" : {
            "type" : "text",
            "analyzer" : "standard"
          },
          "gl2_remote_ip" : {
            "type" : "keyword"
          },
          "gl2_remote_port" : {
            "type" : "keyword"
          },
          "gl2_source_input" : {
            "type" : "keyword"
          },
          "gl2_source_node" : {
            "type" : "keyword"
          },
          "host" : {
            "type" : "keyword"
          },
          "http_referrer" : {
            "type" : "keyword"
          },
          "http_status" : {
            "type" : "keyword"
          },
          "http_user_agent" : {
            "type" : "keyword"
          },
          "http_x_forwarded_for" : {
            "type" : "keyword"
          },
          "json" : {
            "type" : "keyword"
          },
          "lb-fqdn" : {
            "type" : "keyword"
          },
          "level" : {
            "type" : "long"
          },
          "message" : {
            "type" : "text",
            "analyzer" : "standard"
          },
          "nas_ip" : {
            "type" : "keyword"
          },
          "nginx_access" : {
            "type" : "keyword"
          },
          "nginx_error" : {
            "type" : "keyword"
          },
          "oauthclient" : {
            "type" : "keyword"
          },
          "pkg" : {
            "type" : "keyword"
          },
          "platform" : {
            "type" : "keyword"
          },
          "port_index" : {
            "type" : "keyword"
          },
          "remote_addr" : {
            "type" : "keyword"
          },
          "request" : {
            "type" : "keyword"
          },
          "request_id" : {
            "type" : "keyword"
          },
          "request_method" : {
            "type" : "keyword"
          },
          "request_time" : {
            "type" : "float"
          },
          "response_status" : {
            "type" : "long"
          },
          "response_time" : {
            "type" : "keyword"
          },
          "response_time_nums" : {
            "type" : "float"
          },
          "server" : {
            "type" : "keyword"
          },
          "source" : {
            "type" : "text",
            "analyzer" : "analyzer_keyword",
            "fielddata" : true
          },
          "streams" : {
            "type" : "keyword"
          },
          "switch_ip" : {
            "type" : "keyword"
          },
          "switch_mac" : {
            "type" : "keyword"
          },
          "switch_port" : {
            "type" : "keyword"
          },
          "system" : {
            "type" : "keyword"
          },
          "time_to_live" : {
            "type" : "keyword"
          },
          "timestamp" : {
            "type" : "date",
            "format" : "yyyy-MM-dd HH:mm:ss.SSS"
          },
          "upstream_addr" : {
            "type" : "keyword"
          },
          "upstream_cache_status" : {
            "type" : "keyword"
          },
          "upstream_connect_time" : {
            "type" : "keyword"
          },
          "upstream_header_time" : {
            "type" : "keyword"
          },
          "upstream_response_time" : {
            "type" : "keyword"
          },
          "url_without_param" : {
            "type" : "keyword"
          },
          "user_agent" : {
            "type" : "keyword"
          },
          "value" : {
            "type" : "keyword"
          },
          "x-project" : {
            "type" : "keyword"
          },
          "x_forwarded_for" : {
            "type" : "keyword"
          },
          "x_real_ip" : {
            "type" : "keyword"
          },
          "x_real_ipv6" : {
            "type" : "keyword"
          },
          "x_request_id" : {
            "type" : "keyword"
          }
        }
      }
    }
  }
}

```

and response\_time is a float data `"response_time_nums" : { "type" : "float"` but somehow they are not displayed.

---

<div class="post-metadata">

**Author:** ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)\
**Post date:** [September 6, 2019, 12:45pm UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/2 "2019-09-06T12:45:55Z")

</div>

you should create a custom mapping, that this is always stored as number:

[http://docs.graylog.org/en/3.1/pages/configuration/elasticsearch.html#custom-index-mappings](http://docs.graylog.org/en/3.1/pages/configuration/elasticsearch.html#custom-index-mappings)

so all future datapoints are saved correctly.

Only if you have a range selected where the data comes out of the correct datapoints the statistic function will return anything.

Jan

---

<div class="post-metadata">

**Author:** ![Uporaba](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/uporaba/32/11232_2.png) [@Uporaba](https://community.graylog.org/u/Uporaba)\
**Post date:** [September 9, 2019, 11:27am UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/3 "2019-09-09T11:27:01Z")

</div>

I’m a little confused about what I need to do. Can you give me an example based on my data?

---

<div class="post-metadata">

**Author:** ![Uporaba](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/uporaba/32/11232_2.png) [@Uporaba](https://community.graylog.org/u/Uporaba)\
**Post date:** [September 9, 2019, 11:34am UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/4 "2019-09-09T11:34:24Z")

</div>

@jan

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/8/883b27e43150f8b62bf8a26bac934ff509f6f1ee.png)  
I didn’t change the settings to the ones you offered me. But now for some reason the data appeared. But if I put search last 8 hours the data does not appear:  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/b/b7f92892507c6d2f7856c016daba6d2ad8e91a5c.png)  
in the interval from 5 minutes to 2 hours the data is.

---

<div class="post-metadata">

**Author:** ![Uporaba](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/uporaba/32/11232_2.png) [@Uporaba](https://community.graylog.org/u/Uporaba)\
**Post date:** [September 9, 2019, 11:43am UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/5 "2019-09-09T11:43:37Z")

</div>

when I enter `curl -X GET 'http://localhost:9200/graylog_deflector/_mapping?pretty '` shows me that the **request\_time**  
field is of type **float** is this correct or not?

---

<div class="post-metadata">

**Author:** ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)\
**Post date:** [September 9, 2019, 12:38pm UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/6 "2019-09-09T12:38:56Z")

</div>

that happens because on index creation the first ingested value was a number … this will work if the fist ingested value is a number but will break if it becomes a string again - for whatever reason.

With a custom mapping you force a specific field type.

---

<div class="post-metadata">

**Author:** ![Uporaba](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/uporaba/32/11232_2.png) [@Uporaba](https://community.graylog.org/u/Uporaba)\
**Post date:** [September 10, 2019, 9:29am UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/7 "2019-09-10T09:29:01Z")

</div>

@jan why then after a **search for 8 hours** all breaking?

---

<div class="post-metadata">

**Author:** ![Uporaba](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/uporaba/32/11232_2.png) [@Uporaba](https://community.graylog.org/u/Uporaba)\
**Post date:** [September 10, 2019, 9:29am UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/8 "2019-09-10T09:29:54Z")

</div>

although if I put the **search for 2 hours** then everything is ok

---

<div class="post-metadata">

**Author:** ![Uporaba](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/uporaba/32/11232_2.png) [@Uporaba](https://community.graylog.org/u/Uporaba)\
**Post date:** [September 10, 2019, 9:30am UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/9 "2019-09-10T09:30:34Z")

</div>

@jan what diagnostic need to be carried out to find a problem?

---

<div class="post-metadata">

**Author:** ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)\
**Post date:** [September 10, 2019, 9:31am UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/10 "2019-09-10T09:31:05Z")

</div>

I guess you search in multiple indices and the type of that field is different in those indices.

---

<div class="post-metadata">

**Author:** ![Uporaba](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/uporaba/32/11232_2.png) [@Uporaba](https://community.graylog.org/u/Uporaba)\
**Post date:** [September 10, 2019, 9:32am UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/11 "2019-09-10T09:32:00Z")

</div>

@jan how then to fix this error on other indices?

---

<div class="post-metadata">

**Author:** ![Uporaba](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/uporaba/32/11232_2.png) [@Uporaba](https://community.graylog.org/u/Uporaba)\
**Post date:** [September 10, 2019, 9:35am UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/12 "2019-09-10T09:35:10Z")

</div>

@jan I checked. other indexes have the same type of float for this field

---

<div class="post-metadata">

**Author:** ![Uporaba](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/uporaba/32/11232_2.png) [@Uporaba](https://community.graylog.org/u/Uporaba)\
**Post date:** [September 10, 2019, 11:00am UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/13 "2019-09-10T11:00:10Z")

</div>

@jan I figured out what was the matter. How can I change the data type in old indexes?

---

<div class="post-metadata">

**Author:** ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)\
**Post date:** [September 10, 2019, 11:22am UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/14 "2019-09-10T11:22:42Z")

</div>

only by re-index the data.

That is not a task you can do within Graylog.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [September 24, 2019, 11:22am UTC](https://community.graylog.org/t/some-field-show-nan-and-errors/11862/15 "2019-09-24T11:22:44Z")

</div>

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