Value gets truncated

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)


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 and see how the data looks like?

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


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