Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nzjess
Created October 18, 2017 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nzjess/d815f03240f739df2a72112dcac7d28c to your computer and use it in GitHub Desktop.
Save nzjess/d815f03240f739df2a72112dcac7d28c to your computer and use it in GitHub Desktop.
Building and running logstash-filter-geoip tests from source, errors
jesse ~/source
> git clone git@github.com:logstash-plugins/logstash-filter-geoip.git
Cloning into 'logstash-filter-geoip'...
remote: Counting objects: 863, done.
remote: Total 863 (delta 0), reused 0 (delta 0), pack-reused 863
Receiving objects: 100% (863/863), 3.79 MiB | 813.00 KiB/s, done.
Resolving deltas: 100% (367/367), done.
jesse ~/source
> cd logstash-filter-geoip/
jesse ~/source/logstash-filter-geoip (master)
> git lol -10
921d1cd by Jordan Sissel - Add continent-based city databases. Fixes #121 (3 months ago)
87861fb by Jordan Sissel - Update SHA1 based on today's file from Maxmind (9 weeks ago)
22f733d by Jordan Sissel - Version bump (9 weeks ago)
e22420c by Joao Duarte - make deprecated field lru_cache_size obsolete (3 months ago)
b57cf65 by Joao Duarte - on travis test against 5.6 and 6.0 logstash-core (3 months ago)
c340a54 by Aaron Mildenstein - Merge pull request #127 from untergeek/feature/126 (3 months ago)
0ed009f by Aaron Mildenstein - Bundle ASN database in vendor (3 months ago)
4ba0e76 by Pier-Hugues Pellerin - [skip ci] Updating the plugin id in the doc to match the index in the docbook (4 months ago)
ce4971d by Pier-Hugues Pellerin - bump patch level for doc generation (4 months ago)
1d87826 by Pier-Hugues Pellerin - [skip ci] Updating the plugin doc (4 months ago)
jesse ~/source/logstash-filter-geoip (master)
> gem install bundler
Fetching: bundler-1.15.4.gem (100%)
Successfully installed bundler-1.15.4
1 gem installed
jesse ~/source/logstash-filter-geoip (master)
> bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies....
Fetching rake 12.1.0
Installing rake 12.1.0
Fetching benchmark-ips 2.7.2
Installing benchmark-ips 2.7.2
Using bundler 1.15.4
Fetching numerizer 0.1.1
Installing numerizer 0.1.1
Fetching clamp 0.6.5
Installing clamp 0.6.5
Fetching coderay 1.1.2
Installing coderay 1.1.2
Fetching concurrent-ruby 1.0.5 (java)
Installing concurrent-ruby 1.0.5 (java)
Fetching diff-lcs 1.3
Installing diff-lcs 1.3
Fetching multi_json 1.12.2
Installing multi_json 1.12.2
Fetching multipart-post 2.0.0
Installing multipart-post 2.0.0
Fetching ffi 1.9.18 (java)
Installing ffi 1.9.18 (java)
Fetching filesize 0.0.4
Installing filesize 0.0.4
Fetching fivemat 1.3.5
Installing fivemat 1.3.5
Fetching gem_publisher 1.5.0
Installing gem_publisher 1.5.0
Fetching gems 0.8.3
Installing gems 0.8.3
Fetching i18n 0.6.9
Installing i18n 0.6.9
Fetching insist 1.0.0
Installing insist 1.0.0
Fetching jar-dependencies 0.3.11
Installing jar-dependencies 0.3.11
Fetching jrjackson 0.4.4 (java)
Installing jrjackson 0.4.4 (java)
Fetching jruby-openssl 0.9.19 (java)
Installing jruby-openssl 0.9.19 (java)
Fetching kramdown 1.14.0
Installing kramdown 1.14.0
Fetching manticore 0.6.1 (java)
Installing manticore 0.6.1 (java)
Fetching minitar 0.5.4
Installing minitar 0.5.4
Fetching method_source 0.8.2
Installing method_source 0.8.2
Fetching slop 3.6.0
Installing slop 3.6.0
Fetching puma 2.16.0 (java)
Installing puma 2.16.0 (java)
Fetching rack 1.6.6
Installing rack 1.6.6
Fetching ruby-maven-libs 3.3.9
Installing ruby-maven-libs 3.3.9
Fetching rubyzip 1.1.7
Installing rubyzip 1.1.7
Fetching tilt 2.0.8
Installing tilt 2.0.8
Fetching stud 0.0.23
Installing stud 0.0.23
Fetching thread_safe 0.3.6 (java)
Installing thread_safe 0.3.6 (java)
Fetching polyglot 0.3.5
Installing polyglot 0.3.5
Fetching rspec-support 3.7.0
Installing rspec-support 3.7.0
Fetching chronic_duration 0.10.6
Installing chronic_duration 0.10.6
Fetching elasticsearch-api 5.0.4
Installing elasticsearch-api 5.0.4
Fetching faraday 0.13.1
Installing faraday 0.13.1
Fetching spoon 0.0.6
Installing spoon 0.0.6
Fetching rack-protection 1.5.3
Installing rack-protection 1.5.3
Fetching ruby-maven 3.3.12
# Logstash Plugin
[![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-filter-geoip.svg)](https://travis-ci.org/logstash-plugins/logstash-filter-geoip)
This is a plugin for [Logstash](https://github.com/elastic/logstash).
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
## Documentation
Installing ruby-maven 3.3.12
Fetching treetop 1.4.15
Installing treetop 1.4.15
Fetching rspec-core 3.7.0
Installing rspec-core 3.7.0
Fetching rspec-expectations 3.7.0
Installing rspec-expectations 3.7.0
Fetching rspec-mocks 3.7.0
Installing rspec-mocks 3.7.0
Fetching elasticsearch-transport 5.0.4
Installing elasticsearch-transport 5.0.4
Fetching pry 0.10.4 (java)
Installing pry 0.10.4 (java)
Fetching sinatra 1.4.8
Installing sinatra 1.4.8
[
Fetching rspec 3.7.0
Installing rspec 3.7.0
Fetching elasticsearch 5.0.4
Installing elasticsearch 5.0.4
Fetching rspec-wait 0.0.9
Installing rspec-wait 0.0.9
Fetching logstash-core 5.5.1.snapshot1 (java)
Installing logstash-core 5.5.1.snapshot1 (java)
jar dependencies for logstash-core-5.5.1.snapshot1-java.gemspec . . .
org.apache.logging.log4j:log4j-api:2.6.2:compile
org.apache.logging.log4j:log4j-core:2.6.2:compile
com.fasterxml.jackson.core:jackson-core:2.7.4:compile
com.fasterxml.jackson.core:jackson-databind:2.7.4:compile
com.fasterxml.jackson.module:jackson-module-afterburner:2.7.4:compile
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.7.4:compile
Fetching logstash-core-plugin-api 2.1.27 (java)
Installing logstash-core-plugin-api 2.1.27 (java)
Fetching logstash-devutils 1.3.5 (java)
Installing logstash-devutils 1.3.5 (java)
Using logstash-filter-geoip 5.0.1 (java) from source at `.`
Bundle complete! 3 Gemfile dependencies, 54 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from jar-dependencies:
if you want to use the executable lock_jars then install ruby-maven gem before using lock_jars
$ gem install ruby-maven -v '~> 3.3.11'
or add it as a development dependency to your Gemfile
gem 'ruby-maven', '~> 3.3.11'
jesse ~/source/logstash-filter-geoip (master)
> bundle exec rake vendor
# Logstash Plugin
[![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-filter-geoip.svg)](https://travis-ci.org/logstash-plugins/logstash-filter-geoip)
This is a plugin for [Logstash](https://github.com/elastic/logstash).
mkdir vendor/
Downloading http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
rake aborted!
SHA1 does not match (expected '327fb6545e9fa6a632b6c791eea77f47a988a4ab' but got 'b99d287d8f6f979c8b42b32e18b108e79aef7d54')
/Users/jesse/bin/jruby-9.1.13.0/bin/bundle:23:in `<main>'
Errno::ENOENT: No such file or directory - vendor/GeoLite2-City.mmdb.gz
/Users/jesse/bin/jruby-9.1.13.0/bin/bundle:23:in `<main>'
Tasks: TOP => vendor/GeoLite2-City.mmdb.gz
(See full trace by running task with --trace)
# Logstash Plugin
[![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-filter-geoip.svg)](https://travis-ci.org/logstash-plugins/logstash-filter-geoip)
This is a plugin for [Logstash](https://github.com/elastic/logstash).
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
## Documentation
Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
- For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
jesse ~/source/logstash-filter-geoip (master)
> vi vendor.json
jesse ~/source/logstash-filter-geoip (master)
> git diff
diff --git a/vendor.json b/vendor.json
index 22087ce..e76db2f 100644
--- a/vendor.json
+++ b/vendor.json
@@ -1,7 +1,7 @@
[
{
"url": "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz",
- "sha1": "327fb6545e9fa6a632b6c791eea77f47a988a4ab"
+ "sha1": "b99d287d8f6f979c8b42b32e18b108e79aef7d54"
},
{
"url": "https://s3.amazonaws.com/download.elasticsearch.org/logstash/maxmind/GeoLite2-ASN.mmdb",
jesse ~/source/logstash-filter-geoip (master)
> 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/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
BUILD SUCCESSFUL
Total time: 5.462 secs
jesse ~/source/logstash-filter-geoip (master)
> bundle exec rake install_jars
rake aborted!
Don't know how to build task 'install_jars' (see --tasks)
/Users/jesse/bin/jruby-9.1.13.0/bin/bundle:23:in `<main>'
(See full trace by running task with --trace)
jesse ~/source/logstash-filter-geoip (master)
> bundle exec rspec
--- 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.00609 seconds (files took 3.37 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment