# Using geoip properly

**URL:** <https://discuss.elastic.co/t/using-geoip-properly/136955>\
**Category:** Logstash\
**Created:** [June 22, 2018, 1:09am UTC](https://discuss.elastic.co/t/using-geoip-properly/136955 "2018-06-22T01:09:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PSi\_AU](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/psi_au/32/5617_2.png) [@PSi\_AU](https://discuss.elastic.co/u/PSi_AU)\
**Post date:** [June 22, 2018, 1:09am UTC](https://discuss.elastic.co/t/using-geoip-properly/136955/1 "2018-06-22T01:09:40Z")

</div>

Hi,

I'm using geoip but would like to make sure i'm implementing it correctly.  
So my config looks like this:  
filter {  
geoip {  
source =\> "ip"  
database =\> "/usr/share/GeoIP/GeoLite2-City.mmdb"  
}  
geoip {  
source =\> "client\_ip"  
database =\> "/usr/share/GeoIP/GeoLite2-City.mmdb"  
}  
geoip {  
source =\> "fail2ban\_ip"  
database =\> "/usr/share/GeoIP/GeoLite2-City.mmdb"  
}  
geoip {  
source =\> "dovecot\_auth\_fail\_rip"  
database =\> "/usr/share/GeoIP/GeoLite2-City.mmdb"  
}  
geoip {  
source =\> "system\_auth\_ip"  
database =\> "/usr/share/GeoIP/GeoLite2-City.mmdb"  
}  
geoip {  
source =\> "system\_auth\_srcip"  
database =\> "/usr/share/GeoIP/GeoLite2-City.mmdb"  
}  
}

When logstash starts, this shows in the log files:  
[2018-06-21T19:32:11,583][INFO][logstash.filters.geoip] Using geoip database {:path=\>"/usr/share/GeoIP/GeoLite2-City.mmdb"}  
[2018-06-21T19:32:11,716][INFO][logstash.filters.geoip] Using geoip database {:path=\>"/usr/share/GeoIP/GeoLite2-City.mmdb"}  
[2018-06-21T19:32:11,726][INFO][logstash.filters.geoip] Using geoip database {:path=\>"/usr/share/GeoIP/GeoLite2-City.mmdb"}  
[2018-06-21T19:32:11,733][INFO][logstash.filters.geoip] Using geoip database {:path=\>"/usr/share/GeoIP/GeoLite2-City.mmdb"}  
[2018-06-21T19:32:11,736][INFO][logstash.filters.geoip] Using geoip database {:path=\>"/usr/share/GeoIP/GeoLite2-City.mmdb"}  
[2018-06-21T19:32:11,741][INFO][logstash.filters.geoip] Using geoip database {:path=\>"/usr/share/GeoIP/GeoLite2-City.mmdb"}

Is there a way I can specify ONCE where the GeoLite database is and have geoip use it for all sources?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 25, 2018, 9:55pm UTC](https://discuss.elastic.co/t/using-geoip-properly/136955/2 "2018-06-25T21:55:15Z")

</div>

> Is there a way I can specify ONCE where the GeoLite database is and have geoip use it for all sources?

No.

---

<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 23, 2018, 9:55pm UTC](https://discuss.elastic.co/t/using-geoip-properly/136955/3 "2018-07-23T21:55:17Z")

</div>

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