# Set geoloacation variable type in json

**URL:** <https://discuss.elastic.co/t/set-geoloacation-variable-type-in-json/204200>\
**Category:** Logstash\
**Created:** [October 18, 2019, 9:55am UTC](https://discuss.elastic.co/t/set-geoloacation-variable-type-in-json/204200 "2019-10-18T09:55:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cperzrt10](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cperzrt10/32/116152_2.png) [@cperzrt10](https://discuss.elastic.co/u/cperzrt10)\
**Post date:** [October 18, 2019, 9:55am UTC](https://discuss.elastic.co/t/set-geoloacation-variable-type-in-json/204200/1 "2019-10-18T09:55:17Z")

</div>

I need to convert data type in logstash to send it to kibana , right now kibana recieve it like long type y want to convert into geolocation to use kibana´s map  
i have this :

> ```
> {
> "varname":[
> {
> "name": "Alpha", "locationB": [3.14159,2.8283] 
> },
> { 
> "name": "Beta","locationB": [3.14159,2.8283]
> },
> ...
> ]
> }
> 
> ```

I need how to know to get this in filebeat to use in kibana

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 18, 2019, 12:04pm UTC](https://discuss.elastic.co/t/set-geoloacation-variable-type-in-json/204200/2 "2019-10-18T12:04:46Z")

</div>

You need to set an index template that tells elasticsearch it is a geo\_point. See [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html).

---

<div class="post-metadata">

**Author:** ![cperzrt10](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cperzrt10/32/116152_2.png) [@cperzrt10](https://discuss.elastic.co/u/cperzrt10)\
**Post date:** [October 18, 2019, 12:21pm UTC](https://discuss.elastic.co/t/set-geoloacation-variable-type-in-json/204200/3 "2019-10-18T12:21:50Z")

</div>

if i do this all the index that have theese variable change the var type?

soo , I dont know how to do this , ... ;(

---

<div class="post-metadata">

**Author:** ![cperzrt10](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cperzrt10/32/116152_2.png) [@cperzrt10](https://discuss.elastic.co/u/cperzrt10)\
**Post date:** [October 18, 2019, 12:48pm UTC](https://discuss.elastic.co/t/set-geoloacation-variable-type-in-json/204200/4 "2019-10-18T12:48:07Z")

</div>

i got this

> {  
> "error": {  
> "root\_cause": [  
> {  
> "type": "resource\_already\_exists\_exception",  
> "reason": "index [logstash-2019.10.18/WkbT-3mxRkW1avQz-WFQKQ] already exists",  
> "index\_uuid": "WkbT-3mxRkW1avQz-WFQKQ",  
> "index": "logstash-2019.10.18"  
> }  
> ],  
> "type": "resource\_already\_exists\_exception",  
> "reason": "index [logstash-2019.10.18/WkbT-3mxRkW1avQz-WFQKQ] already exists",  
> "index\_uuid": "WkbT-3mxRkW1avQz-WFQKQ",  
> "index": "logstash-2019.10.18"  
> },  
> "status": 400  
> }

doing this:

> PUT logstash-2019.10.18  
> {  
> "mappings": {  
> "properties": {  
> "namex": {  
> "type": "geo\_point"  
> }  
> }  
> }  
> }

---

<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:** [November 15, 2019, 12:48pm UTC](https://discuss.elastic.co/t/set-geoloacation-variable-type-in-json/204200/5 "2019-11-15T12:48:07Z")

</div>

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