mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Fix path used to load the embedded geoip database (LOGSTASH-734)
This commit is contained in:
parent
46712eb832
commit
47a8ace6a9
1 changed files with 3 additions and 1 deletions
|
@ -31,7 +31,7 @@ class LogStash::Filters::GeoIP < LogStash::Filters::Base
|
|||
if @database.nil?
|
||||
if __FILE__ =~ /^file:\/.+!.+/
|
||||
# Running from a jar, assume GeoLiteCity.dat is at the root.
|
||||
@database = [__FILE__.split("!").first, "GeoLiteCity.dat"].join("!")
|
||||
@database = [__FILE__.split("!").first, "/GeoLiteCity.dat"].join("!")
|
||||
else
|
||||
if File.exists?("GeoLiteCity.dat")
|
||||
@database = "GeoLiteCity.dat"
|
||||
|
@ -40,7 +40,9 @@ class LogStash::Filters::GeoIP < LogStash::Filters::Base
|
|||
end
|
||||
end
|
||||
end
|
||||
@logger.info("Using geoip database", :path => @database)
|
||||
@geoip = ::GeoIP.new(@database)
|
||||
|
||||
@geoip_type = case @geoip.database_type
|
||||
when GeoIP::GEOIP_CITY_EDITION_REV0, GeoIP::GEOIP_CITY_EDITION_REV1
|
||||
:city
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue