fluent-plugin-filter-geoip 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/fluent-plugin-filter-geoip.gemspec +2 -2
- data/lib/fluent/plugin/filter_geoip.rb +10 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b394007f701fdea8a0e5b2f8b0cafe9d7a5b68a1
|
4
|
+
data.tar.gz: 48b6ef59f37e98ca4973a2bfc6eb81f868c19d1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c51b02d5de7ab10e8b6759ef8c9406a5a243d23622f0509b40fc9cd1a7eb8223018ca9ad40f15eab006c72b49834133c81d5fcf13120101409837b97e704d52f
|
7
|
+
data.tar.gz: 0773eb70ae13d01804cc0aa41a44b41de996ef1bb99e8c31a6d15e562a7888f6e19ffa56e186aefae17994c1a8466b7e0a838d849319f98387be1ac82a5586f4
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ This is a [Fluentd](http://fluentd.org/) filter plugin for adding [GeoIP data](h
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```
|
10
|
-
gem 'fluent-plugin-
|
10
|
+
gem 'fluent-plugin-filter-geoip'
|
11
11
|
```
|
12
12
|
|
13
13
|
And then execute:
|
@@ -16,7 +16,7 @@ And then execute:
|
|
16
16
|
|
17
17
|
Or install it yourself as:
|
18
18
|
|
19
|
-
$ gem install fluent-plugin-
|
19
|
+
$ gem install fluent-plugin-filter-geoip
|
20
20
|
|
21
21
|
## Config parameters
|
22
22
|
|
@@ -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-filter-geoip"
|
7
|
-
spec.version = "0.3.
|
7
|
+
spec.version = "0.3.1"
|
8
8
|
spec.authors = ["Minoru Osuka"]
|
9
9
|
spec.email = ["minoru.osuka@gmail.com"]
|
10
10
|
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_runtime_dependency 'fluentd', '~> 0.12.19'
|
23
23
|
spec.add_runtime_dependency 'maxminddb', '~> 0.1.8'
|
24
24
|
|
25
|
-
spec.add_development_dependency 'bundler', '~> 1.
|
25
|
+
spec.add_development_dependency 'bundler', '~> 1.12.4'
|
26
26
|
spec.add_development_dependency 'rake', '~> 10.5.0'
|
27
27
|
spec.add_development_dependency 'test-unit', '~> 3.1.5'
|
28
28
|
spec.add_development_dependency 'minitest', '~> 5.8.3'
|
@@ -31,7 +31,7 @@ module Fluent
|
|
31
31
|
DEFAULT_TRAITS = true
|
32
32
|
DEFAULT_CONNECTION_TYPE = true
|
33
33
|
|
34
|
-
config_param :enable_auto_download, :
|
34
|
+
config_param :enable_auto_download, :bool, :default => DEFAULT_ENABLE_DOWNLOAD,
|
35
35
|
:desc => 'If true, enable to download GeoIP2 database autometically (default: %s).' % DEFAULT_ENABLE_DOWNLOAD
|
36
36
|
|
37
37
|
config_param :md5_url, :string, :default => DEFAULT_MD5_URL,
|
@@ -109,7 +109,14 @@ module Fluent
|
|
109
109
|
ip = record[@lookup_field]
|
110
110
|
|
111
111
|
unless ip.nil? then
|
112
|
-
|
112
|
+
|
113
|
+
geoip = {}
|
114
|
+
begin
|
115
|
+
geoip = @database.lookup(ip)
|
116
|
+
rescue IPAddr::InvalidAddressError => e
|
117
|
+
# Do nothing if if InvalidAddressError
|
118
|
+
return record
|
119
|
+
end
|
113
120
|
|
114
121
|
if geoip.found? then
|
115
122
|
if @continent then
|
@@ -343,7 +350,7 @@ module Fluent
|
|
343
350
|
end
|
344
351
|
end
|
345
352
|
|
346
|
-
log.
|
353
|
+
log.debug "Record: %s" % record.inspect
|
347
354
|
else
|
348
355
|
log.warn "It was not possible to look up the #{ip}."
|
349
356
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-filter-geoip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minoru Osuka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.12.4
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.12.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
131
|
rubyforge_project:
|
132
|
-
rubygems_version: 2.0.14
|
132
|
+
rubygems_version: 2.0.14.1
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Fluent filter plugin for adding GeoIP data to record.
|