# POST to Elastic Search as and int

**URL:** <https://discuss.elastic.co/t/post-to-elastic-search-as-and-int/99957>\
**Category:** Elasticsearch\
**Created:** [September 10, 2017, 1:15am UTC](https://discuss.elastic.co/t/post-to-elastic-search-as-and-int/99957 "2017-09-10T01:15:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![connor\_o2](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@connor\_o2](https://discuss.elastic.co/u/connor_o2)\
**Post date:** [September 10, 2017, 1:15am UTC](https://discuss.elastic.co/t/post-to-elastic-search-as-and-int/99957/1 "2017-09-10T01:15:10Z")

</div>

Hi Guys,

Im just wondering if anyone has been able to POST an integer to ES, using JSON. I have tried a few different ways of doing with no success, The data is ingested but always as a string. does anyone has any hints they would be able to proved, or advice on if this is even possible ?

Different syntax I have tired (yes some are stupidly wrong)

{  
"Temp": "{{data}}",  
"Temp2": "{data}",  
"Temp3": "[data]",  
"Temp4": "[{data}]",  
"Temp5": {  
"data": {  
"type": "integer"  
}  
},  
"Time": "published\_at",  
"convert": {  
"temp6": "data",  
"type": "integer"  
}  
}

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/1/31c6f8a0b6fe6aea9164e15f457137868453ca13.png)

any help would be awesome .... im running out of ideas !

cheers  
Connor

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 10, 2017, 1:38am UTC](https://discuss.elastic.co/t/post-to-elastic-search-as-and-int/99957/2 "2017-09-10T01:38:11Z")

</div>

Are you posting the above json, exactly as you have it?

---

<div class="post-metadata">

**Author:** ![connor\_o2](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@connor\_o2](https://discuss.elastic.co/u/connor_o2)\
**Post date:** [September 10, 2017, 2:00am UTC](https://discuss.elastic.co/t/post-to-elastic-search-as-and-int/99957/3 "2017-09-10T02:00:05Z")

</div>

Yes, but I'm using a third party device to do the actual POST to SERVERNAME:9200/my\_index/my\_type/1

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 10, 2017, 2:01am UTC](https://discuss.elastic.co/t/post-to-elastic-search-as-and-int/99957/4 "2017-09-10T02:01:20Z")

</div>

But you're posting text where you want an int?

---

<div class="post-metadata">

**Author:** ![connor\_o2](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@connor\_o2](https://discuss.elastic.co/u/connor_o2)\
**Post date:** [September 10, 2017, 2:05am UTC](https://discuss.elastic.co/t/post-to-elastic-search-as-and-int/99957/5 "2017-09-10T02:05:01Z")

</div>

You are correct,

Sorry I forgot I have also tried it as  
"Temp": {{data}},  
"Temp2": {data}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 10, 2017, 2:06am UTC](https://discuss.elastic.co/t/post-to-elastic-search-as-and-int/99957/6 "2017-09-10T02:06:20Z")

</div>

Well we can't help with whatever is posting the data.

But what does a document show is in those fields if you look at it in Discover?

---

<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:** [October 8, 2017, 2:06am UTC](https://discuss.elastic.co/t/post-to-elastic-search-as-and-int/99957/7 "2017-10-08T02:06:24Z")

</div>

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