I cloned the geoip plugin source from github:
https://github.com/logstash-plugins/logstash-filter-geoip/commit/921d1cd
Followed the README to install the pre-reqs:
bundle install
bundle exec rake vendor
Then ran the tests:
bundle exec rspec
But I got the following error:
--- jar coordinate com.fasterxml.jackson.core:jackson-databind already loaded with version 2.7.4 - omit version 2.9.1
--- jar coordinate com.fasterxml.jackson.core:jackson-annotations already loaded with version 2.7.0 - omit version 2.9.1
--- jar coordinate com.fasterxml.jackson.module:jackson-module-afterburner already loaded with version 2.7.4 - omit version 2.9.1
--- jar coordinate com.fasterxml.jackson.core:jackson-core already loaded with version 2.7.4 - omit version 2.9.1
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
An error occurred while loading ./spec/filters/geoip_spec.rb.
Failure/Error: # encoding: utf-8
ArgumentError:
invalid level[OFF] for logger[]
# ./spec/filters/geoip_spec.rb:1:in `<main>'
# ./spec/filters/geoip_spec.rb:2:in `(root)'
# ------------------
# --- Caused by: ---
# NoMethodError:
# undefined method `getConfiguration' for nil:NilClass
# ./spec/filters/geoip_spec.rb:1:in `<main>'
No examples found.
Finished in 0.00555 seconds (files took 2.74 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples
A debugged a bit and what's happening is that the code is reaching line 97 of logger.rb:
jruby-9.1.13.0/lib/ruby/gems/shared/gems/logstash-core-5.5.1.snapshot1-java/lib/logstash/logging/logger.rb:97
Which looks like this:
# Clone of org.apache.logging.log4j.core.config.Configurator.setLevel(), but using initialized @@logging_context
def self.set_level(_level, path)
configuration = @@logging_context.getConfiguration()
level = Level.valueOf(_level)
if path.nil? || path.strip.empty?
And @@logging_context
is nil at this point.
It's like self.initialize(config_location) in that file is never called for some reason?
def self.initialize(config_location)
@@config_mutex.synchronize do
if @@logging_context.nil?
Not sure if this is relevant, but here's the output of bundle exec rake vendor
:
Downloading https://s3.amazonaws.com/download.elasticsearch.org/logstash/maxmind/GeoLite2-ASN.mmdb
Downloading https://s3.amazonaws.com/download.elasticsearch.org/logstash/maxmind/LICENSE.txt
-------------------> Wrote /Users/jesse/Devel/ubercraft/source/logstash-filter-geoip/gradle.properties
logstashCoreGemPath=/Users/jesse/bin/jruby-9.1.13.0/lib/ruby/gems/shared/gems/logstash-core-5.5.1.snapshot1-java
logstashCoreEventGemPath=Could not find gem 'logstash-core-event'.
Starting a Gradle Daemon (subsequent builds will be faster)
:generateGemJarRequiresFile
:compileJava
:processResources UP-TO-DATE
:classes
:jar
:vendor
Can anyone tell me what I'm doing wrong?
Thanks,
Jesse.