# Why graylog convert my INT to String

**URL:** <https://community.graylog.org/t/why-graylog-convert-my-int-to-string/25915>\
**Category:** Graylog Central (peer support)\
**Created:** [September 26, 2022, 4:19pm UTC](https://community.graylog.org/t/why-graylog-convert-my-int-to-string/25915 "2022-09-26T16:19:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![loicattena](https://avatars.discourse-cdn.com/v4/letter/l/d07c76/32.png) [@loicattena](https://community.graylog.org/u/loicattena)\
**Post date:** [September 26, 2022, 4:19pm UTC](https://community.graylog.org/t/why-graylog-convert-my-int-to-string/25915/1 "2022-09-26T16:19:34Z")

</div>

Hi,

I’am sending logs to Graylog by Gelf who are streamed to OpenSearch.  
The problem is that Graylog display the fields who has been sent as int as string.

For example, if I sent : {“version”:“1.1”, “host”: “little bird”, “short\_message”: “Warrior from the North”, “level”:1, “\_cpm”: 10}  
The “\_cpm” field will be saved as string in graylog and opensearch but I sent a integer.

Someone already got this problem ?

Thanks

---

<div class="post-metadata">

**Author:** ![tmacgbay](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/tmacgbay/32/3878_2.png) [@tmacgbay](https://community.graylog.org/u/tmacgbay)\
**Post date:** [September 26, 2022, 7:52pm UTC](https://community.graylog.org/t/why-graylog-convert-my-int-to-string/25915/2 "2022-09-26T19:52:43Z")

</div>

ElasticSearch will guess at they type of field at the creation of each Index, I am reasonably sure that OpenSearch is the same. If you rotate the index, it will choose type anew… so if you are forcing a long, it should capture as a long on the creation of the next index.

Assuming that works, It is possible to correct a field to a long historically if you want… Here is a [write up](https://community.graylog.org/t/custom-mappings-and-historical-correction/21130/5) for an older version but it likely can be used in OpenSearch with a little tweaking.

---

<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:** [October 10, 2022, 7:53pm UTC](https://community.graylog.org/t/why-graylog-convert-my-int-to-string/25915/3 "2022-10-10T19:53:21Z")

</div>

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