fluent-plugin-geoip 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6064156b8f481d751a7f1ee92c5e80b189c52f2c
4
- data.tar.gz: 95e5509ad5ec16ff48e9d71687caa205bd4dbf85
3
+ metadata.gz: 2ba51a787a4970750c7198634fd098dcb310c05a
4
+ data.tar.gz: 8e8fdc8b26e46c28f37bee711877e115df7293a0
5
5
  SHA512:
6
- metadata.gz: c3fcd73dcac19ab974974099f05147e1ba082cf339b0c45ae00971049cadf94cf6d8c1a438351c0c08cd7a51f5fcba03c01013760ff21422275757cc7adcd270
7
- data.tar.gz: f6d8bb596b0c423e041d69f520cbb0fd6268c7a36bf7910e32b1a189fe2c5da560a6c41f2f95fa5a93b83c70cce1edf999994bac65f28a0f88b7f0fdc01e3bd6
6
+ metadata.gz: 65b5ecb8009f1317f2f15dc1be73a935ce4298658497d3b329452ae95f66628ad20ba74014905738bb6a09ec5d6bb5005a48f25f5716cd0608ea1c2316994ee4
7
+ data.tar.gz: b7eded32d4b0c8babb7f417902e4565c592ed2af89e0bb5253165263c45704eef6feeadf1bd1787936a9e2dc96e4fecefef2cf2738ba778428c41d600fc621ff
@@ -6,14 +6,14 @@ env:
6
6
  global:
7
7
  DOCKER_COMPOSE_VERSION: 1.8.1
8
8
  matrix:
9
- - TARGET_RUBY_VERSION=2.1 BUNDLE_GEMFILE=/app/Gemfile
10
- - TARGET_RUBY_VERSION=2.2 BUNDLE_GEMFILE=/app/Gemfile
11
- - TARGET_RUBY_VERSION=2.3 BUNDLE_GEMFILE=/app/Gemfile
12
- - TARGET_RUBY_VERSION=2.4 BUNDLE_GEMFILE=/app/Gemfile
13
- - TARGET_RUBY_VERSION=2.1 BUNDLE_GEMFILE=/app/gemfiles/fluentd_v0.12.gemfile
14
- - TARGET_RUBY_VERSION=2.2 BUNDLE_GEMFILE=/app/gemfiles/fluentd_v0.12.gemfile
15
- - TARGET_RUBY_VERSION=2.3 BUNDLE_GEMFILE=/app/gemfiles/fluentd_v0.12.gemfile
16
- - TARGET_RUBY_VERSION=2.4 BUNDLE_GEMFILE=/app/gemfiles/fluentd_v0.12.gemfile
9
+ - TARGET_RUBY_VERSION=2.1 BUNDLE_GEMFILE=/app/gemfiles/fluentd_v1.0_with_backport_dig.gemfile
10
+ - TARGET_RUBY_VERSION=2.2 BUNDLE_GEMFILE=/app/gemfiles/fluentd_v1.0_with_backport_dig.gemfile
11
+ - TARGET_RUBY_VERSION=2.3 BUNDLE_GEMFILE=/app/gemfiles/fluentd_v1.0_without_backport_dig.gemfile
12
+ - TARGET_RUBY_VERSION=2.4 BUNDLE_GEMFILE=/app/gemfiles/fluentd_v1.0_without_backport_dig.gemfile
13
+ - TARGET_RUBY_VERSION=2.1 BUNDLE_GEMFILE=/app/gemfiles/fluentd_v0.12_with_backport_dig.gemfile
14
+ - TARGET_RUBY_VERSION=2.2 BUNDLE_GEMFILE=/app/gemfiles/fluentd_v0.12_with_backport_dig.gemfile
15
+ - TARGET_RUBY_VERSION=2.3 BUNDLE_GEMFILE=/app/gemfiles/fluentd_v0.12_without_backport_dig.gemfile
16
+ - TARGET_RUBY_VERSION=2.4 BUNDLE_GEMFILE=/app/gemfiles/fluentd_v0.12_without_backport_dig.gemfile
17
17
 
18
18
  before_install:
19
19
  #- sudo apt-get update
data/Appraisals CHANGED
@@ -1,4 +1,17 @@
1
- appraise "fluentd v0.12" do
1
+ appraise "fluentd v0.12 with backport_dig" do
2
2
  gem "fluentd", "~> 0.12.0"
3
+ gem "backport_dig", "~> 1.0.0"
3
4
  end
4
5
 
6
+ appraise "fluentd v0.12 without backport_dig" do
7
+ gem "fluentd", "~> 0.12.0"
8
+ end
9
+
10
+ appraise "fluentd v1.0 with backport_dig" do
11
+ gem "fluentd", "~> 1.0.0"
12
+ gem "backport_dig", "~> 1.0.0"
13
+ end
14
+
15
+ appraise "fluentd v1.0 without backport_dig" do
16
+ gem "fluentd", "~> 1.0.0"
17
+ end
data/README.md CHANGED
@@ -28,6 +28,8 @@ $ sudo apt-get install libmaxminddb-dev
28
28
  # for OS X
29
29
  $ brew install geoip
30
30
  $ brew install libmaxminddb
31
+ $ bundle config build.geoip-c --with-geoip-dir=/usr/local/include/
32
+ $ bundle config build.geoip2_c --with-opt-include=/usr/local/include/
31
33
  ```
32
34
 
33
35
  ## Installation
@@ -0,0 +1 @@
1
+ Database and Contents Copyright (c) 2017 MaxMind, Inc.
Binary file
Binary file
@@ -0,0 +1,3 @@
1
+ This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
2
+
3
+ This database incorporates GeoNames [http://www.geonames.org] geographical data, which is made available under the Creative Commons Attribution 3.0 License. To view a copy of this license, visit http://www.creativecommons.org/licenses/by/3.0/us/.
@@ -0,0 +1 @@
1
+ Latitude and longitude are not precise and should not be used to identify a particular street address or household.
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-geoip"
7
- spec.version = "0.7.0"
7
+ spec.version = "0.8.0"
8
8
  spec.authors = ["Kentaro Yoshida"]
9
9
  spec.email = ["y.ken.studio@gmail.com"]
10
10
  spec.summary = %q{Fluentd Filter plugin to add information about geographical location of IP addresses with Maxmind GeoIP databases.}
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "fluentd", "~> 0.12.0"
6
+ gem "backport_dig", "~> 1.0.0"
7
+
8
+ gemspec path: "../"
@@ -1,8 +1,7 @@
1
1
  # This file was generated by Appraisal
2
2
 
3
- source "http://rubygems.org"
3
+ source "https://rubygems.org"
4
4
 
5
5
  gem "fluentd", "~> 0.12.0"
6
6
 
7
- gemspec :path => "../"
8
-
7
+ gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "fluentd", "~> 1.0.0"
6
+ gem "backport_dig", "~> 1.0.0"
7
+
8
+ gemspec path: "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "fluentd", "~> 1.0.0"
6
+
7
+ gemspec path: "../"
@@ -1,6 +1,14 @@
1
1
  require 'geoip'
2
2
  require 'yajl'
3
- require 'dig_rb'
3
+ unless {}.respond_to?(:dig)
4
+ begin
5
+ # backport_dig is faster than dig_rb so prefer backport_dig.
6
+ # And Fluentd v1.0.1 uses backport_dig
7
+ require 'backport_dig'
8
+ rescue LoadError
9
+ require 'dig_rb'
10
+ end
11
+ end
4
12
 
5
13
  module Fluent
6
14
  class GeoIP
@@ -177,13 +177,13 @@ class GeoipFilterTest < Test::Unit::TestCase
177
177
  messages = [
178
178
  {'host' => '203.0.113.1', 'message' => 'invalid ip'},
179
179
  {'host' => '0', 'message' => 'invalid ip'},
180
- {'host' => '8.8.8.8', 'message' => 'google public dns'}
180
+ {'host' => '66.102.3.80', 'message' => 'google bot'}
181
181
  ]
182
182
  expected = [
183
183
  {'host' => '203.0.113.1', 'message' => 'invalid ip'},
184
184
  {'host' => '0', 'message' => 'invalid ip'},
185
- {'host' => '8.8.8.8', 'message' => 'google public dns',
186
- 'geoip_city' => 'Mountain View', 'geopoint' => [-122.0838, 37.386]}
185
+ {'host' => '66.102.3.80', 'message' => 'google bot',
186
+ 'geoip_city' => 'Mountain View', 'geopoint' => [-122.0574, 37.419200000000004]}
187
187
  ]
188
188
  filtered = filter(config, messages)
189
189
  assert_equal(expected, filtered)
@@ -446,13 +446,13 @@ class GeoipFilterTest < Test::Unit::TestCase
446
446
  messages = [
447
447
  {'host' => '203.0.113.1', 'message' => 'invalid ip'},
448
448
  {'host' => '0', 'message' => 'invalid ip'},
449
- {'host' => '8.8.8.8', 'message' => 'google public dns'}
449
+ {'host' => '66.102.3.80', 'message' => 'google bot'}
450
450
  ]
451
451
  expected = [
452
452
  {'host' => '203.0.113.1', 'message' => 'invalid ip'},
453
453
  {'host' => '0', 'message' => 'invalid ip'},
454
- {'host' => '8.8.8.8', 'message' => 'google public dns',
455
- 'geoip_city' => 'Mountain View', 'geopoint' => [-122.0838, 37.386]}
454
+ {'host' => '66.102.3.80', 'message' => 'google bot',
455
+ 'geoip_city' => 'Mountain View', 'geopoint' => [-122.0574, 37.419200000000004]}
456
456
  ]
457
457
  filtered = filter(config, messages)
458
458
  assert_equal(expected, filtered)
@@ -746,13 +746,13 @@ class GeoipFilterTest < Test::Unit::TestCase
746
746
  messages = [
747
747
  {'host' => '203.0.113.1', 'message' => 'invalid ip'},
748
748
  {'host' => '0', 'message' => 'invalid ip'},
749
- {'host' => '8.8.8.8', 'message' => 'google public dns'}
749
+ {'host' => '66.102.3.80', 'message' => 'google bot'}
750
750
  ]
751
751
  expected = [
752
752
  {'host' => '203.0.113.1', 'message' => 'invalid ip'},
753
753
  {'host' => '0', 'message' => 'invalid ip'},
754
- {'host' => '8.8.8.8', 'message' => 'google public dns',
755
- 'geoip_city' => 'Mountain View', 'geopoint' => [-122.08380126953125, 37.38600158691406]}
754
+ {'host' => '66.102.3.80', 'message' => 'google bot',
755
+ 'geoip_city' => 'Mountain View', 'geopoint' => [-122.05740356445312, 37.4192008972168]}
756
756
  ]
757
757
  filtered = filter(config, messages)
758
758
  assert_equal(expected, filtered)
@@ -229,7 +229,7 @@ class GeoipOutputTest < Test::Unit::TestCase
229
229
  # 203.0.113.1 is a test address described in RFC5737
230
230
  d1.emit({'host' => '203.0.113.1', 'message' => 'invalid ip'})
231
231
  d1.emit({'host' => '0', 'message' => 'invalid ip'})
232
- d1.emit({'host' => '8.8.8.8', 'message' => 'google public dns'})
232
+ d1.emit({'host' => '66.102.3.80', 'message' => 'google bot'})
233
233
  end
234
234
  emits = d1.emits
235
235
  assert_equal 3, emits.length
@@ -240,7 +240,7 @@ class GeoipOutputTest < Test::Unit::TestCase
240
240
  assert_equal nil, emits[1][2]['geoip_city']
241
241
  assert_equal nil, emits[1][2]['geopoint']
242
242
  assert_equal 'Mountain View', emits[2][2]['geoip_city']
243
- assert_equal [-122.0838, 37.386], emits[2][2]['geopoint']
243
+ assert_equal [-122.0574, 37.419200000000004], emits[2][2]['geopoint']
244
244
  end
245
245
 
246
246
  def test_emit_record_directive
@@ -523,7 +523,7 @@ class GeoipOutputTest < Test::Unit::TestCase
523
523
  # 203.0.113.1 is a test address described in RFC5737
524
524
  d1.emit({'host' => '203.0.113.1', 'message' => 'invalid ip'})
525
525
  d1.emit({'host' => '0', 'message' => 'invalid ip'})
526
- d1.emit({'host' => '8.8.8.8', 'message' => 'google public dns'})
526
+ d1.emit({'host' => '66.102.3.80', 'message' => 'google bot'})
527
527
  end
528
528
  emits = d1.emits
529
529
  assert_equal 3, emits.length
@@ -534,7 +534,7 @@ class GeoipOutputTest < Test::Unit::TestCase
534
534
  assert_equal nil, emits[1][2]['geoip_city']
535
535
  assert_equal nil, emits[1][2]['geopoint']
536
536
  assert_equal 'Mountain View', emits[2][2]['geoip_city']
537
- assert_equal [-122.0838, 37.386], emits[2][2]['geopoint']
537
+ assert_equal [-122.0574, 37.419200000000004], emits[2][2]['geopoint']
538
538
  end
539
539
 
540
540
  def test_emit_record_directive
@@ -848,7 +848,7 @@ class GeoipOutputTest < Test::Unit::TestCase
848
848
  # 203.0.113.1 is a test address described in RFC5737
849
849
  d1.emit({'host' => '203.0.113.1', 'message' => 'invalid ip'})
850
850
  d1.emit({'host' => '0', 'message' => 'invalid ip'})
851
- d1.emit({'host' => '8.8.8.8', 'message' => 'google public dns'})
851
+ d1.emit({'host' => '66.102.3.80', 'message' => 'google bot'})
852
852
  end
853
853
  emits = d1.emits
854
854
  assert_equal 3, emits.length
@@ -859,7 +859,8 @@ class GeoipOutputTest < Test::Unit::TestCase
859
859
  assert_equal nil, emits[1][2]['geoip_city']
860
860
  assert_equal nil, emits[1][2]['geopoint']
861
861
  assert_equal 'Mountain View', emits[2][2]['geoip_city']
862
- assert_equal [-122.08380126953125, 37.38600158691406], emits[2][2]['geopoint']
862
+ assert_equal [-122.05740356445312, 37.4192008972168], emits[2][2]['geopoint']
863
+
863
864
  end
864
865
 
865
866
  def test_emit_multiple_key
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-geoip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kentaro Yoshida
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-17 00:00:00.000000000 Z
11
+ date: 2017-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -164,14 +164,21 @@ files:
164
164
  - LICENSE
165
165
  - README.md
166
166
  - Rakefile
167
+ - data/COPYRIGHT.txt
168
+ - data/GeoLite2-City.mmdb
167
169
  - data/GeoLiteCity.dat
170
+ - data/LICENSE.txt
171
+ - data/README.txt
168
172
  - docker-compose.yml
169
173
  - dockerfiles/Dockerfile-ruby2.1
170
174
  - dockerfiles/Dockerfile-ruby2.2
171
175
  - dockerfiles/Dockerfile-ruby2.3
172
176
  - dockerfiles/Dockerfile-ruby2.4
173
177
  - fluent-plugin-geoip.gemspec
174
- - gemfiles/fluentd_v0.12.gemfile
178
+ - gemfiles/fluentd_v0.12_with_backport_dig.gemfile
179
+ - gemfiles/fluentd_v0.12_without_backport_dig.gemfile
180
+ - gemfiles/fluentd_v1.0_with_backport_dig.gemfile
181
+ - gemfiles/fluentd_v1.0_without_backport_dig.gemfile
175
182
  - lib/fluent/plugin/filter_geoip.rb
176
183
  - lib/fluent/plugin/geoip.rb
177
184
  - lib/fluent/plugin/out_geoip.rb
@@ -198,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
205
  version: '0'
199
206
  requirements: []
200
207
  rubyforge_project:
201
- rubygems_version: 2.4.5
208
+ rubygems_version: 2.6.13
202
209
  signing_key:
203
210
  specification_version: 4
204
211
  summary: Fluentd Filter plugin to add information about geographical location of IP