# How to create a geo\_point field in logstash for a default index logstash-\*

**URL:** https://discuss.elastic.co/t/how-to-create-a-geo-point-field-in-logstash-for-a-default-index-logstash/138830
**Category:** Logstash
**Created:** [July 6, 2018, 6:23am UTC](https://discuss.elastic.co/t/how-to-create-a-geo-point-field-in-logstash-for-a-default-index-logstash/138830 "2018-07-06T06:23:32Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![George\_Cherian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/george_cherian/32/25879_2.png) [@George\_Cherian](https://discuss.elastic.co/u/George_Cherian)
#### Post date: [July 6, 2018, 6:23am UTC](https://discuss.elastic.co/t/how-to-create-a-geo-point-field-in-logstash-for-a-default-index-logstash/138830/1 "2018-07-06T06:23:32Z")

</div>

Hi

How to make a field geo\_point type in logstash itself , so that I don't need to initial create a index manually with geo\_point temple and the use it in logstash , which is double work.

Thanks  
George

---

<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: [July 6, 2018, 6:33am UTC](https://discuss.elastic.co/t/how-to-create-a-geo-point-field-in-logstash-for-a-default-index-logstash/138830/2 "2018-07-06T06:33:42Z")

</div>

You should leverage templates for your mappings, that is the best way if you are using a non `logstash-` named index.

---

<div class="post-metadata">

### Author: ![George\_Cherian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/george_cherian/32/25879_2.png) [@George\_Cherian](https://discuss.elastic.co/u/George_Cherian)
#### Post date: [July 6, 2018, 7:05am UTC](https://discuss.elastic.co/t/how-to-create-a-geo-point-field-in-logstash-for-a-default-index-logstash/138830/3 "2018-07-06T07:05:48Z")

</div>

> [@warkolm](#):
>
> your mappings, that is the best way if you are using a non `logstash`

how can it be done for logstash-named index?

---

<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: [July 6, 2018, 7:18am UTC](https://discuss.elastic.co/t/how-to-create-a-geo-point-field-in-logstash-for-a-default-index-logstash/138830/4 "2018-07-06T07:18:39Z")

</div>

Are you changing the name of the field, or using the defaults from the geoip filter?

---

<div class="post-metadata">

### Author: ![George\_Cherian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/george_cherian/32/25879_2.png) [@George\_Cherian](https://discuss.elastic.co/u/George_Cherian)
#### Post date: [July 6, 2018, 10:22am UTC](https://discuss.elastic.co/t/how-to-create-a-geo-point-field-in-logstash-for-a-default-index-logstash/138830/5 "2018-07-06T10:22:57Z")

</div>

> [@warkolm](#):
>
> geoip

I need the location field shown in the below snippet as geo\_point , so for that can I use geoip plugin instead of mutate?

filter{  
if[Site] == "Manassas"  
{  
mutate{  
add\_field =\> { "location" =\> "38.7509,-77.4753" }  
}  
}  
........

---

<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: [July 7, 2018, 7:13am UTC](https://discuss.elastic.co/t/how-to-create-a-geo-point-field-in-logstash-for-a-default-index-logstash/138830/6 "2018-07-07T07:13:37Z")

</div>

Ohh ok, now that makes sense. (Side note, posting your config can help get a resolution a bit quicker 🙂 )

You may need to adapt the existing template, because the default one by Logstash uses `geoip.location` but you are using just `location`. Otherwise, just call that field `geoip.location`.

---

<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: [August 4, 2018, 7:13am UTC](https://discuss.elastic.co/t/how-to-create-a-geo-point-field-in-logstash-for-a-default-index-logstash/138830/7 "2018-08-04T07:13:40Z")

</div>

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