# Geoip log file

**URL:** <https://discuss.elastic.co/t/geoip-log-file/341901>\
**Category:** Elasticsearch\
**Created:** [August 29, 2023, 3:14pm UTC](https://discuss.elastic.co/t/geoip-log-file/341901 "2023-08-29T15:14:59Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndyB](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@AndyB](https://discuss.elastic.co/u/AndyB)\
**Post date:** [August 29, 2023, 3:14pm UTC](https://discuss.elastic.co/t/geoip-log-file/341901/1 "2023-08-29T15:14:59Z")

</div>

I would like to see if the geoip database is being downloaded. Getting information from Bard, it tells me that I need to create a file on my server here:

/var/log/geoip/geoip.log

I have done this but the geoip.log file is empty. First question, is this correct? Second question how can I trigger Elasticsearch to download the geoip database so that I can see if the log file gets updated.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [August 29, 2023, 5:22pm UTC](https://discuss.elastic.co/t/geoip-log-file/341901/2 "2023-08-29T17:22:30Z")

</div>

Hello, can you provide a little more context of you want to do?

> [@AndyB](#):
>
> Getting information from Bard, it tells me that I need to create a file on my server here

Not sure what this mean, but this seems to be completely made up by the A.I. tool.

> [@AndyB](#):
>
> I would like to see if the geoip database is being downloaded.

You could check Elasticsearch logs or use the `_ingest` API as explained in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/geoip-stats-api.html).

Running the following request in Dev Tools may help.

```auto
GET _ingest/geoip/stats

```

---

<div class="post-metadata">

**Author:** ![AndyB](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@AndyB](https://discuss.elastic.co/u/AndyB)\
**Post date:** [August 30, 2023, 5:07am UTC](https://discuss.elastic.co/t/geoip-log-file/341901/3 "2023-08-30T05:07:24Z")

</div>

Thank you for the information, leandrojmp. I ran the following command in SSH and it looks like there have been 0 downloads.

![pic001](https://us1.discourse-cdn.com/elastic/original/3X/4/6/463c01b1e3b10a58782dffdf439e5c749dabf1bd.jpeg)

I'm running Elasticsearch 8.8.2. Is it normal that the geoip is being downloaded as default?

---

<div class="post-metadata">

**Author:** ![AndyB](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@AndyB](https://discuss.elastic.co/u/AndyB)\
**Post date:** [August 31, 2023, 12:56am UTC](https://discuss.elastic.co/t/geoip-log-file/341901/4 "2023-08-31T00:56:30Z")

</div>

I wonder if the reason I'm not seeing any successful downloads is due to me not allowing outside access to post 9200. Are the geoip database updates done through post 9200?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [August 31, 2023, 1:21am UTC](https://discuss.elastic.co/t/geoip-log-file/341901/5 "2023-08-31T01:21:58Z")

</div>

> [@AndyB](#):
>
> Are the geoip database updates done through post 9200?

No, the geoip databases are downloaded from `geoip.elastic.co` using port `443`.

Do you have any ingest pipeline using the `geoip` processor? It will only download the database if you have at least one ingest pipeline using the `geoip` processor.

The [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/geoip-processor.html#geoip-processor) has more information on what will be downloaded and from where.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 31, 2023, 2:06am UTC](https://discuss.elastic.co/t/geoip-log-file/341901/6 "2023-08-31T02:06:21Z")

</div>

Also starting lately the geo DBs are "lazy Loaded"

> Blockquote

So you need to actually run the geoip processor once to trigger the download/ install...

That is a new "Feature" that kept me up late one night!  
🙂

---

<div class="post-metadata">

**Author:** ![AndyB](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@AndyB](https://discuss.elastic.co/u/AndyB)\
**Post date:** [August 31, 2023, 2:08am UTC](https://discuss.elastic.co/t/geoip-log-file/341901/7 "2023-08-31T02:08:33Z")

</div>

> [@leandrojmp](#):
>
> Do you have any ingest pipeline using the `geoip` processor?

I do not. So that explains why I'm not seeing any successful downloads of the geoip database.

Thank you.

---

<div class="post-metadata">

**Author:** ![AndyB](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@AndyB](https://discuss.elastic.co/u/AndyB)\
**Post date:** [August 31, 2023, 2:09am UTC](https://discuss.elastic.co/t/geoip-log-file/341901/8 "2023-08-31T02:09:23Z")

</div>

Thank you, stephanb, that is also very useful information.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 31, 2023, 2:10am UTC](https://discuss.elastic.co/t/geoip-log-file/341901/9 "2023-08-31T02:10:50Z")

</div>

Just run the sample

```auto
PUT _ingest/pipeline/geoip
{
  "description" : "Add geoip info",
  "processors" : [
    {
      "geoip" : {
        "field" : "ip"
      }
    }
  ]
}
PUT my-index-000001/_doc/my_id?pipeline=geoip
{
  "ip": "89.160.20.128"
}
GET my-index-000001/_doc/my_id

```

The check the stats again

---

<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:** [September 28, 2023, 2:11am UTC](https://discuss.elastic.co/t/geoip-log-file/341901/10 "2023-09-28T02:11:39Z")

</div>

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