# GeoPoint

**URL:** <https://discuss.elastic.co/t/geopoint/149462>\
**Category:** Elasticsearch\
**Created:** [September 21, 2018, 1:17pm UTC](https://discuss.elastic.co/t/geopoint/149462 "2018-09-21T13:17:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mheni](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Mheni](https://discuss.elastic.co/u/Mheni)\
**Post date:** [September 21, 2018, 1:17pm UTC](https://discuss.elastic.co/t/geopoint/149462/1 "2018-09-21T13:17:04Z")

</div>

Hello;

My csv File contain two seperated ( with pipe) columns longititude and latitude ... How can i put them to a single GeoPoint Location??

```
PUT /GeoLoc
{
    "mappings": {
        "doc": {
            "properties": {
                "location": {
                    "type": "geo_point"
                }
            }
        }
    }
}
```

---

<div class="post-metadata">

**Author:** ![fkelbert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fkelbert/32/35762_2.png) [@fkelbert](https://discuss.elastic.co/u/fkelbert)\
**Post date:** [September 21, 2018, 3:39pm UTC](https://discuss.elastic.co/t/geopoint/149462/2 "2018-09-21T15:39:39Z")

</div>

Generally, you would insert the data as follows:

```
PUT GeoLoc/doc/1
{ 
  "location": {
    "lat": 41.12,
    "lon": -71.34
  }
}

```

This is further described in the [Geopoint documentation](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/geo-point.html).

Now, it depends how you are ingesting data into Elasticsearch. Are you using Beats, Logstash, or some other homebrewn solution?

- [Logstash solution](https://discuss.elastic.co/t/how-to-construct-geo-point-field-from-separate-fields-of-latitude-and-longitude-for-kibana-5-4/91755)

---

<div class="post-metadata">

**Author:** ![Mheni](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Mheni](https://discuss.elastic.co/u/Mheni)\
**Post date:** [September 21, 2018, 3:56pm UTC](https://discuss.elastic.co/t/geopoint/149462/3 "2018-09-21T15:56:48Z")

</div>

this insert is a single point. I have to put file with 1000 geoPoint

---

<div class="post-metadata">

**Author:** ![fkelbert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fkelbert/32/35762_2.png) [@fkelbert](https://discuss.elastic.co/u/fkelbert)\
**Post date:** [September 21, 2018, 4:05pm UTC](https://discuss.elastic.co/t/geopoint/149462/4 "2018-09-21T16:05:33Z")

</div>

Sure, that's why I was asking for additional details of your setup. You can either fire 1000 PUT operations from your own application, or use Logstash or Filebeat to process your file. All of these are valid solutions, but it depends. Any of them might be the best in your case.

Please also look into the Logstash link that I provided. It will give you an idea on how to configure Logstash to achieve what you want using the `mutate` filter.

---

<div class="post-metadata">

**Author:** ![Mheni](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Mheni](https://discuss.elastic.co/u/Mheni)\
**Post date:** [September 24, 2018, 1:40pm UTC](https://discuss.elastic.co/t/geopoint/149462/5 "2018-09-24T13:40:16Z")

</div>

thank you Florian,

what about GeoIp if I have a column named ipAddress.

---

<div class="post-metadata">

**Author:** ![fkelbert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fkelbert/32/35762_2.png) [@fkelbert](https://discuss.elastic.co/u/fkelbert)\
**Post date:** [September 24, 2018, 1:55pm UTC](https://discuss.elastic.co/t/geopoint/149462/6 "2018-09-24T13:55:34Z")

</div>

Hi Mheni,

Can you please be more precise? What is the content of this column? What is its data format? What do you want achieve with the data that's in it?

Please be very specific when asking questions and do provide examples. Otherwise, it is very hard to know what you want to achieve and thus impossible to help.

---

<div class="post-metadata">

**Author:** ![Mheni](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Mheni](https://discuss.elastic.co/u/Mheni)\
**Post date:** [September 24, 2018, 2:06pm UTC](https://discuss.elastic.co/t/geopoint/149462/7 "2018-09-24T14:06:43Z")

</div>

the structure of my csv file ; 4 columns sepratad by | containing Date, Time, Source Ip Adress and Destination IpAddress. How can i configure Logstash to put these Ip on Map?

* * *

Date|Time|Source|destination  
20180308|235537|78.191.69.130|78.191.68.189

---

<div class="post-metadata">

**Author:** ![fkelbert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fkelbert/32/35762_2.png) [@fkelbert](https://discuss.elastic.co/u/fkelbert)\
**Post date:** [September 24, 2018, 4:14pm UTC](https://discuss.elastic.co/t/geopoint/149462/8 "2018-09-24T16:14:09Z")

</div>

Your Logstash configuration below. Please also see the documentation on Logstash [geoip filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-geoip.html) and Logstash [csv filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-csv.html).

```
input {
  file {
    path => "input.csv"
  }
}

filter {
  csv {
    separator => "|"
    columns => ["date", "time", "source", "destination"]
  }
  geoip {
    source => "source"
    target => "geoip_source"
  }
  geoip {
    source => "destination"
    target => "geoip_destination"
  }
}

output {
  elasticsearch {
    index => "geoip-example"
  }
}
```

---

<div class="post-metadata">

**Author:** ![Mheni](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Mheni](https://discuss.elastic.co/u/Mheni)\
**Post date:** [September 25, 2018, 9:14am UTC](https://discuss.elastic.co/t/geopoint/149462/9 "2018-09-25T09:14:07Z")

</div>

> [@fkelbert](#):
>
> geoip { source =\> "source" target =\> "geoip\_source" } geoip { source =\> "destination" target =\> "geoip\_destination" }

Thank you Florient,  
And for Kibana how to put the Mapping, and how to visualise all sources IP for example.

---

<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 23, 2018, 9:14am UTC](https://discuss.elastic.co/t/geopoint/149462/10 "2018-10-23T09:14:11Z")

</div>

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