fluent-plugin-geoip 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +9 -0
- data/README.md +1 -1
- data/fluent-plugin-geoip.gemspec +1 -1
- data/lib/fluent/plugin/out_geoip.rb +4 -7
- metadata +3 -2
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# fluent-plugin-geoip
|
1
|
+
# fluent-plugin-geoip [![Build Status](https://travis-ci.org/y-ken/fluent-plugin-geoip.png?branch=master)](https://travis-ci.org/y-ken/fluent-plugin-geoip)
|
2
2
|
|
3
3
|
Fluentd Output plugin to add information about geographical location of IP addresses with Maxmind GeoIP databases.
|
4
4
|
|
data/fluent-plugin-geoip.gemspec
CHANGED
@@ -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.0.
|
7
|
+
spec.version = "0.0.4"
|
8
8
|
spec.authors = ["Kentaro Yoshida"]
|
9
9
|
spec.email = ["y.ken.studio@gmail.com"]
|
10
10
|
spec.summary = %q{Fluentd Output plugin to add information about geographical location of IP addresses with Maxmind GeoIP databases.}
|
@@ -2,7 +2,7 @@ class Fluent::GeoipOutput < Fluent::BufferedOutput
|
|
2
2
|
Fluent::Plugin.register_output('geoip', self)
|
3
3
|
|
4
4
|
GEOIP_KEYS = %w(city latitude longitude country_code3 country_code country_name dma_code area_code region)
|
5
|
-
config_param :geoip_database, :string, :default => 'data/GeoLiteCity.dat'
|
5
|
+
config_param :geoip_database, :string, :default => File.dirname(__FILE__) + '/../../../data/GeoLiteCity.dat'
|
6
6
|
config_param :geoip_lookup_key, :string, :default => 'host'
|
7
7
|
|
8
8
|
include Fluent::HandleTagNameMixin
|
@@ -53,12 +53,9 @@ class Fluent::GeoipOutput < Fluent::BufferedOutput
|
|
53
53
|
address = record[@geoip_lookup_key]
|
54
54
|
return record if address.nil?
|
55
55
|
result = @geoip.look_up(address)
|
56
|
-
if result.nil?
|
57
|
-
|
58
|
-
|
59
|
-
@geoip_keys_map.each do |geoip_key,record_key|
|
60
|
-
record.store(record_key, result[geoip_key.to_sym])
|
61
|
-
end
|
56
|
+
return record if result.nil?
|
57
|
+
@geoip_keys_map.each do |geoip_key,record_key|
|
58
|
+
record.store(record_key, result[geoip_key.to_sym])
|
62
59
|
end
|
63
60
|
return record
|
64
61
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-geoip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-09-
|
12
|
+
date: 2013-09-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -83,6 +83,7 @@ extensions: []
|
|
83
83
|
extra_rdoc_files: []
|
84
84
|
files:
|
85
85
|
- .gitignore
|
86
|
+
- .travis.yml
|
86
87
|
- Gemfile
|
87
88
|
- LICENSE
|
88
89
|
- README.md
|