# Search geo data by IP address

**URL:** <https://discuss.elastic.co/t/search-geo-data-by-ip-address/321559>\
**Category:** Elasticsearch\
**Created:** [December 19, 2022, 12:59pm UTC](https://discuss.elastic.co/t/search-geo-data-by-ip-address/321559 "2022-12-19T12:59:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lamka02sk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lamka02sk/32/114923_2.png) [@lamka02sk](https://discuss.elastic.co/u/lamka02sk)\
**Post date:** [December 19, 2022, 12:59pm UTC](https://discuss.elastic.co/t/search-geo-data-by-ip-address/321559/1 "2022-12-19T12:59:02Z")

</div>

Hi,  
I have an index that contains `geo_point` field. Is there a way to search in this field (for example filter the distance) by an IP address? For example something like this:

```auto
GET /my_locations/_search
{
  "query": {
    "bool": {
      "must": {
        "match_all": {}
      },
      "filter": {
        "geo_distance": {
          "distance": "200km",
          "pin": "8.8.8.8"
        }
      }
    }
  }
}

```

So that the IP address would be automatically converted to `lat` + `lon` just like during ingestion/indexing and only documents within this distance would be returned?

Thanks!

---

<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:** [December 19, 2022, 10:54pm UTC](https://discuss.elastic.co/t/search-geo-data-by-ip-address/321559/2 "2022-12-19T22:54:51Z")

</div>

You would need to run that conversion external to Elasticsearch and then feed it into a query, there's no way to have Elasticsearch automatically translate it for you like that.

---

<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:** [January 16, 2023, 10:55pm UTC](https://discuss.elastic.co/t/search-geo-data-by-ip-address/321559/3 "2023-01-16T22:55:27Z")

</div>

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