# Geolocation help

**URL:** <https://discuss.elastic.co/t/geolocation-help/137582>\
**Category:** Elasticsearch\
**Created:** [June 27, 2018, 9:15am UTC](https://discuss.elastic.co/t/geolocation-help/137582 "2018-06-27T09:15:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oren\_Cohen](https://avatars.discourse-cdn.com/v4/letter/o/4491bb/32.png) [@Oren\_Cohen](https://discuss.elastic.co/u/Oren_Cohen)\
**Post date:** [June 27, 2018, 9:15am UTC](https://discuss.elastic.co/t/geolocation-help/137582/1 "2018-06-27T09:15:49Z")

</div>

The json that is being fed to elastic looks like this:

```
{
    "type": "event",
    "timestamp": "2018-06-18 18:22:59.848",
    "event": "FlightStats",
    "params": {
      "deviceID": "e347afe90c65c19e12789c4e297ed865b4ab0db7",
      "flightID": "411fc194-f09d-428a-b804-640705033561",
      "appVersion": "1.0.28",
      "buildNumber": "61",
      "deviceModel": "System Product Name (System manufacturer)",
      "operatingSystem": "Windows 10 (10.0.0) 64bit",
      "droneModel": "Mavic Pro",
      "cameraModel": "Mavic Pro Camera",
      "flightDuration": "1.2106282",
      "batteryLevelStart": "96",
      "batteryLevel": "96",
      "altitude": "164.9",
      "maxAltitude": "164.9",
      "distance": "0.08320932",
      "maxDistance": "0.08320932",
      "homeLatitude": "32.4941035124032",
      "homeLongitude": "34.9063095064591"
    }

```

This JSON is independent and neither created nor modified on my end. Is it possible to map a "homeLocation" property (that includes the params.homeLatitude and params.homeLongitude) into the index that receives those jsons in order to support geolocation queries, without actually modifying the JSON that is being received?

Thanks,  
Oren

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 27, 2018, 9:28am UTC](https://discuss.elastic.co/t/geolocation-help/137582/2 "2018-06-27T09:28:37Z")

</div>

> without actually modifying the JSON that is being received?

Yes but you need to transform that document before it gets indexed in elasticsearch.  
You can do that with Ingest Node feature.

Basically go from:

```auto
{
    "type": "event",
    "timestamp": "2018-06-18 18:22:59.848",
    "event": "FlightStats",
    "params": {
      "deviceID": "e347afe90c65c19e12789c4e297ed865b4ab0db7",
      "flightID": "411fc194-f09d-428a-b804-640705033561",
      "appVersion": "1.0.28",
      "buildNumber": "61",
      "deviceModel": "System Product Name (System manufacturer)",
      "operatingSystem": "Windows 10 (10.0.0) 64bit",
      "droneModel": "Mavic Pro",
      "cameraModel": "Mavic Pro Camera",
      "flightDuration": "1.2106282",
      "batteryLevelStart": "96",
      "batteryLevel": "96",
      "altitude": "164.9",
      "maxAltitude": "164.9",
      "distance": "0.08320932",
      "maxDistance": "0.08320932",
      "homeLatitude": "32.4941035124032",
      "homeLongitude": "34.9063095064591"
}

```

to

```auto
{
    "type": "event",
    "timestamp": "2018-06-18 18:22:59.848",
    "event": "FlightStats",
    "params": {
      "deviceID": "e347afe90c65c19e12789c4e297ed865b4ab0db7",
      "flightID": "411fc194-f09d-428a-b804-640705033561",
      "appVersion": "1.0.28",
      "buildNumber": "61",
      "deviceModel": "System Product Name (System manufacturer)",
      "operatingSystem": "Windows 10 (10.0.0) 64bit",
      "droneModel": "Mavic Pro",
      "cameraModel": "Mavic Pro Camera",
      "flightDuration": "1.2106282",
      "batteryLevelStart": "96",
      "batteryLevel": "96",
      "altitude": "164.9",
      "maxAltitude": "164.9",
      "distance": "0.08320932",
      "maxDistance": "0.08320932",
      "home": {
          "lat": 32.4941035124032,
          "lon": 34.9063095064591
      }
}

```

---

<div class="post-metadata">

**Author:** ![Oren\_Cohen](https://avatars.discourse-cdn.com/v4/letter/o/4491bb/32.png) [@Oren\_Cohen](https://discuss.elastic.co/u/Oren_Cohen)\
**Post date:** [June 27, 2018, 11:19am UTC](https://discuss.elastic.co/t/geolocation-help/137582/3 "2018-06-27T11:19:43Z")

</div>

I didn't know about the ingest feature and this opened a whole new world of possibilities!

Thank you!  
Oren

---

<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:** [July 25, 2018, 11:19am UTC](https://discuss.elastic.co/t/geolocation-help/137582/4 "2018-07-25T11:19:50Z")

</div>

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