# Value gets truncated

**URL:** <https://discuss.elastic.co/t/value-gets-truncated/187787>\
**Category:** Elasticsearch\
**Created:** [June 27, 2019, 9:08am UTC](https://discuss.elastic.co/t/value-gets-truncated/187787 "2019-06-27T09:08:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elk3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elk3/32/46184_2.png) [@elk3](https://discuss.elastic.co/u/elk3)\
**Post date:** [June 27, 2019, 9:08am UTC](https://discuss.elastic.co/t/value-gets-truncated/187787/1 "2019-06-27T09:08:29Z")

</div>

In database,school\_id(field datatype:'string') values like this (0611,0391,0301,0311,0071,0651)  
but when i moves to elastic index via logstash then the school\_id(field datatype:'string') values shows like this (611,391,301,311,71,651)

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 1, 2019, 9:59am UTC](https://discuss.elastic.co/t/value-gets-truncated/187787/2 "2019-07-01T09:59:27Z")

</div>

Hey,

you need to do a step back and explain your pipeline here in more detail. First, Elasticsearch never ever changes your JSON unless you tell it to do so. As you do not seem to use ingest pipelines, the first step is to check the source of a document. If that already has the leading zeros omitted, this is not about Elasticsearch, but a part of your ingest pipeline doing this.

Is it possible, that your logstash pipeline converts the field to a number and then back to a string, thus omitting the leading zeros? Can you output the logstash parsing to [stdout](https://www.elastic.co/guide/en/logstash/7.2/plugins-outputs-stdout.html) and see how the data looks like?

if not, is there maybe another preprocessing step not mentioned here?

--Alex

---

<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 29, 2019, 9:59am UTC](https://discuss.elastic.co/t/value-gets-truncated/187787/3 "2019-07-29T09:59:28Z")

</div>

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