fluent-plugin-filter-geoip 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 486c0eaea288541dc8e8f1fb44c651aa22979dd5
4
- data.tar.gz: aa88708061c48476208ab0b2d0afabb351670fd3
3
+ metadata.gz: 5f2fd0ecc7c4107238ac0036c23619c8de8c22aa
4
+ data.tar.gz: c670f95a24c05f40f4c85601296b9dec171a2414
5
5
  SHA512:
6
- metadata.gz: ece9b9d918165337bb4896b8708fae36223a11b9de9254a55ae11420694799d6b400621ec9358ad396f2021683ddfb75c4455b035b7905b178b55753b2c429af
7
- data.tar.gz: ec4db585b1d4d3c0103da848ccadde85c8c488465b2552d1e5072fc5cacc5e7ecb007298a9e59c7955a06487ba38753552581e74f6a7fbcfb9fdf4878653b655
6
+ metadata.gz: aef325575c76255ca1479f7649a38fb2bb19e963fa40fe403f804f92d7b91f7882474c09b8f7aba2f4c04acd0e2844bab5f878aaf4f4caaa9efbff6091b4e100
7
+ data.tar.gz: 8a0661ce524170f0d6900789f4f4bc6d7954810813848e73a0f32606fbd6d11b5f9c3f4d5903f2a74836e6e7aaa4691375e4258de88e5b0477cb6438ff945378
data/.gitignore CHANGED
@@ -36,3 +36,6 @@ build/
36
36
 
37
37
  Gemfile.lock
38
38
  geoip
39
+
40
+ # RubyMine
41
+ .idea/
data/README.md CHANGED
@@ -4,19 +4,21 @@ This is a [Fluentd](http://fluentd.org/) filter plugin for adding [GeoIP data](h
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ Install it yourself as:
8
8
 
9
9
  ```
10
- gem 'fluent-plugin-filter-geoip'
10
+ $ gem install fluent-plugin-filter-geoip
11
11
  ```
12
12
 
13
- And then execute:
13
+ ## How to build
14
14
 
15
- $ bundle
16
-
17
- Or install it yourself as:
18
-
19
- $ gem install fluent-plugin-filter-geoip
15
+ ```
16
+ $ gem install bundler
17
+ $ bundle install
18
+ $ rake test
19
+ $ rake build
20
+ $ rake install
21
+ ```
20
22
 
21
23
  ## Config parameters
22
24
 
@@ -193,7 +195,7 @@ connection_type true
193
195
  database_path ./geoip/database/GeoLite2-City.mmdb
194
196
 
195
197
  lookup_field clientip
196
- field_prefix geoip
198
+ output_field geoip
197
199
  field_delimiter .
198
200
  flatten false
199
201
 
@@ -259,6 +261,73 @@ then output bocomes as belows:
259
261
  }
260
262
  ```
261
263
 
264
+
265
+ ## Example command
266
+
267
+ Start fluentd using example fluent.conf.
268
+
269
+ ```
270
+ $ fluentd -c ~/github/fluent-plugin-filter-geoip/fluent.conf
271
+ 2017-03-13 15:11:31 +0900 [info]: reading config file path="/Users/mosuka/github/fluent-plugin-filter-geoip/fluent.conf"
272
+ 2017-03-13 15:11:31 +0900 [info]: starting fluentd-0.12.33
273
+ 2017-03-13 15:11:31 +0900 [info]: gem 'fluent-plugin-filter-geoip' version '0.5.3'
274
+ 2017-03-13 15:11:31 +0900 [info]: gem 'fluent-plugin-grok-parser' version '1.0.0'
275
+ 2017-03-13 15:11:31 +0900 [info]: gem 'fluent-plugin-output-solr' version '0.4.0'
276
+ 2017-03-13 15:11:31 +0900 [info]: gem 'fluent-plugin-ua-parser' version '1.1.0'
277
+ 2017-03-13 15:11:31 +0900 [info]: gem 'fluentd' version '0.12.33'
278
+ 2017-03-13 15:11:31 +0900 [info]: gem 'fluentd' version '0.12.32'
279
+ 2017-03-13 15:11:31 +0900 [info]: adding filter pattern="messages" type="geoip"
280
+ 2017-03-13 15:11:31 +0900 [info]: Current MD5: cc1f9a6f7def282bc33cb477f3379d9f
281
+ 2017-03-13 15:11:31 +0900 [info]: Fetched MD5: cc1f9a6f7def282bc33cb477f3379d9f
282
+ 2017-03-13 15:11:32 +0900 [info]: adding match pattern="messages" type="stdout"
283
+ 2017-03-13 15:11:32 +0900 [info]: adding source type="forward"
284
+ 2017-03-13 15:11:32 +0900 [info]: using configuration file: <ROOT>
285
+ <source>
286
+ @type forward
287
+ port 24224
288
+ </source>
289
+ <filter messages>
290
+ @type geoip
291
+ enable_auto_download true
292
+ md5_url http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.md5
293
+ download_url http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
294
+ md5_path ./geoip/database/GeoLite2-City.md5
295
+ database_path ./geoip/database/GeoLite2-City.mmdb
296
+ lookup_field clientip
297
+ output_field geoip
298
+ field_delimiter .
299
+ flatten false
300
+ locale en
301
+ continent true
302
+ country true
303
+ city true
304
+ location true
305
+ postal true
306
+ registered_country true
307
+ represented_country true
308
+ subdivisions true
309
+ traits true
310
+ connection_type true
311
+ </filter>
312
+ <match messages>
313
+ type stdout
314
+ </match>
315
+ </ROOT>
316
+ 2017-03-13 15:11:32 +0900 [info]: listening fluent socket on 0.0.0.0:24224
317
+ ```
318
+
319
+ Send message via `fluent-cat`.
320
+
321
+ ```
322
+ $ echo '{"clientip": "200.114.49.218"}' | fluent-cat messages
323
+ ```
324
+
325
+ Fluentd outputs message in standard output.
326
+
327
+ ```
328
+ 2017-03-13 15:13:02 +0900 messages: {"clientip":"200.114.49.218","geoip":{"continent":{"code":"SA","geoname_id":6255150,"name":"South America"},"country":{"geoname_id":3686110,"iso_code":"CO","name":"Colombia"},"city":{"geoname_id":3674962,"name":"Medellín"},"location":{"latitude":6.2518,"longitude":-75.5636,"time_zone":"America/Bogota"},"registered_country":{"geoname_id":3686110,"iso_code":"CO","name":"Colombia"},"subdivisions":[{"geoname_id_0":3689815,"iso_code_0":"ANT","name_0":"Antioquia"}]}}
329
+ ```
330
+
262
331
  ## Development
263
332
 
264
333
  After checking out the repo, run `bundle install` to install dependencies. Then, run `rake test` to run the tests.
@@ -266,4 +335,3 @@ After checking out the repo, run `bundle install` to install dependencies. Then,
266
335
  ## Contributing
267
336
 
268
337
  Bug reports and pull requests are welcome on GitHub at https://github.com/mosuka/fluent-plugin-filter-geoip.
269
-
@@ -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.5.2"
7
+ spec.version = "0.5.3"
8
8
  spec.authors = ["Minoru Osuka"]
9
9
  spec.email = ["minoru.osuka@gmail.com"]
10
10
 
@@ -19,10 +19,10 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_runtime_dependency 'fluentd', '~> 0.14.6'
22
+ spec.add_runtime_dependency 'fluentd', '~> 0.12.32'
23
23
  spec.add_runtime_dependency 'maxminddb', '~> 0.1.11'
24
24
 
25
- spec.add_development_dependency 'bundler', '~> 1.13.6'
25
+ spec.add_development_dependency 'bundler', '~> 1.14.6'
26
26
  spec.add_development_dependency 'rake', '~> 11.1.2'
27
27
  spec.add_development_dependency 'test-unit', '~> 3.1.5'
28
28
  spec.add_development_dependency 'minitest', '~> 5.8.3'
data/fluent.conf ADDED
@@ -0,0 +1,36 @@
1
+ <source>
2
+ @type forward
3
+ port 24224
4
+ </source>
5
+
6
+ <filter messages>
7
+ @type geoip
8
+
9
+ enable_auto_download true
10
+ md5_url http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.md5
11
+ download_url http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
12
+ md5_path ./geoip/database/GeoLite2-City.md5
13
+ database_path ./geoip/database/GeoLite2-City.mmdb
14
+
15
+ lookup_field clientip
16
+ output_field geoip
17
+ field_delimiter .
18
+ flatten false
19
+
20
+ locale en
21
+
22
+ continent true
23
+ country true
24
+ city true
25
+ location true
26
+ postal true
27
+ registered_country true
28
+ represented_country true
29
+ subdivisions true
30
+ traits true
31
+ connection_type true
32
+ </filter>
33
+
34
+ <match messages>
35
+ type stdout
36
+ </match>
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.5.2
4
+ version: 0.5.3
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-21 00:00:00.000000000 Z
11
+ date: 2017-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.14.6
19
+ version: 0.12.32
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.14.6
26
+ version: 0.12.32
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: maxminddb
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.13.6
47
+ version: 1.14.6
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.13.6
54
+ version: 1.14.6
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +108,7 @@ files:
108
108
  - README.md
109
109
  - Rakefile
110
110
  - fluent-plugin-filter-geoip.gemspec
111
+ - fluent.conf
111
112
  - lib/fluent/plugin/filter_geoip.rb
112
113
  homepage: https://github.com/mosuka/fluent-plugin-filter-geoip
113
114
  licenses:
@@ -129,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
130
  version: '0'
130
131
  requirements: []
131
132
  rubyforge_project:
132
- rubygems_version: 2.5.1
133
+ rubygems_version: 2.5.2
133
134
  signing_key:
134
135
  specification_version: 4
135
136
  summary: Fluent filter plugin for adding GeoIP data to record.