# Integer precision lost when inserting into elasticsearch?

**URL:** <https://discuss.elastic.co/t/integer-precision-lost-when-inserting-into-elasticsearch/24539>\
**Category:** Logstash\
**Created:** [June 29, 2015, 10:52am UTC](https://discuss.elastic.co/t/integer-precision-lost-when-inserting-into-elasticsearch/24539 "2015-06-29T10:52:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcin\_K](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@Marcin\_K](https://discuss.elastic.co/u/Marcin_K)\
**Post date:** [June 29, 2015, 10:52am UTC](https://discuss.elastic.co/t/integer-precision-lost-when-inserting-into-elasticsearch/24539/1 "2015-06-29T10:52:18Z")

</div>

Hello,  
I've got logstash (1.4.2) inserting data to ES (1.5.2)

Here's a sample command that I'm running

```
echo "ID: 1029713618753128208" | /opt/logstash/bin/logstash -e 'input { stdin {} } filter { grok { match => ["message", "ID: %{NUMBER:id:int}"]} } output { stdout{ codec => rubydebug } elasticsearch { host=> "127.0.0.1" cluster=>"main" protocol=>http } } '

```

stdout codec prints correct number for my variable id:

```
{
       "message" => "ID: 1029713618753128208",
      "@version" => "1",
    "@timestamp" => "2015-06-29T10:50:06.463Z",
          "host" => "debian-vm1",
            "id" => 1029713618753128208
}

```

But elasticsearch when queried shows that id as

```
1029713618753128200

```

It almost looks like there's some kind of loss of precision on the integer.

Does like it look like a known issue ?

Thanks & regards  
m

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [June 30, 2015, 4:04am UTC](https://discuss.elastic.co/t/integer-precision-lost-when-inserting-into-elasticsearch/24539/2 "2015-06-30T04:04:00Z")

</div>

what does your query look like?

It is not rounding though maybe your hitting a max integer of the ES but don't think that would be a diff of 8

Also your mapping might shed some light

---

<div class="post-metadata">

**Author:** ![Marcin\_K](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@Marcin\_K](https://discuss.elastic.co/u/Marcin_K)\
**Post date:** [June 30, 2015, 8:59am UTC](https://discuss.elastic.co/t/integer-precision-lost-when-inserting-into-elasticsearch/24539/3 "2015-06-30T08:59:42Z")

</div>

Aaah, good call eperry,

Turns out logstash/elasticsearch returns data correctly but kibana's display is screwed up.

I've raised issue on kibana 4.1.0

Thanks  
m

---

<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 6, 2017, 5:36am UTC](https://discuss.elastic.co/t/integer-precision-lost-when-inserting-into-elasticsearch/24539/4 "2017-07-06T05:36:02Z")

</div>


