# How to create Scripted field to create a column in Geo json format?

**URL:** <https://discuss.elastic.co/t/how-to-create-scripted-field-to-create-a-column-in-geo-json-format/207887>\
**Category:** Kibana\
**Created:** [November 14, 2019, 12:31pm UTC](https://discuss.elastic.co/t/how-to-create-scripted-field-to-create-a-column-in-geo-json-format/207887 "2019-11-14T12:31:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramya\_Tanikanti](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@Ramya\_Tanikanti](https://discuss.elastic.co/u/Ramya_Tanikanti)\
**Post date:** [November 14, 2019, 12:31pm UTC](https://discuss.elastic.co/t/how-to-create-scripted-field-to-create-a-column-in-geo-json-format/207887/1 "2019-11-14T12:31:41Z")

</div>

Hi, I have created an index with field location of type Geo\_point in the Kibana console. I do not want to configure the logstash config file to create the location filed in geo json format.

Instead I want to create a scripted field for the field name Location.

When I create it using type string it the lat and long values correctly come as - 23.565, 78.909.

But when I create it using the type number, only the first value is given - 23.565.

My Scripted field screenshot using type Number is attached below,

 ![Scripted%20Field](https://us1.discourse-cdn.com/elastic/original/3X/b/6/b66980cabdd3b2d74dece2185d084921371c861e.png)

Kindly help 🙏

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [November 14, 2019, 5:45pm UTC](https://discuss.elastic.co/t/how-to-create-scripted-field-to-create-a-column-in-geo-json-format/207887/2 "2019-11-14T17:45:55Z")

</div>

You're using the number formatter, you should try using the default formatter or setting the field type to string.

---

<div class="post-metadata">

**Author:** ![Ramya\_Tanikanti](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@Ramya\_Tanikanti](https://discuss.elastic.co/u/Ramya_Tanikanti)\
**Post date:** [November 15, 2019, 3:59am UTC](https://discuss.elastic.co/t/how-to-create-scripted-field-to-create-a-column-in-geo-json-format/207887/3 "2019-11-15T03:59:33Z")

</div>

Hi @wylie, after doing what you said I am getting a scripted filed in the required format, but it won't get mapped to the Geopoint field I've previously created right?

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [November 15, 2019, 2:12pm UTC](https://discuss.elastic.co/t/how-to-create-scripted-field-to-create-a-column-in-geo-json-format/207887/4 "2019-11-15T14:12:52Z")

</div>

Right, a scripted field is a separate field. It's not possible to create scripted geopoints, because geopoints must be indexed.

---

<div class="post-metadata">

**Author:** ![Ramya\_Tanikanti](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@Ramya\_Tanikanti](https://discuss.elastic.co/u/Ramya_Tanikanti)\
**Post date:** [November 18, 2019, 1:47am UTC](https://discuss.elastic.co/t/how-to-create-scripted-field-to-create-a-column-in-geo-json-format/207887/5 "2019-11-18T01:47:59Z")

</div>

Thank you @wylie 😃

---

<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:** [December 16, 2019, 1:48am UTC](https://discuss.elastic.co/t/how-to-create-scripted-field-to-create-a-column-in-geo-json-format/207887/6 "2019-12-16T01:48:08Z")

</div>

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