fluent-plugin-filter-geoip 0.5.0 → 0.5.1
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 +4 -4
- data/README.md +37 -41
- data/fluent-plugin-filter-geoip.gemspec +1 -1
- data/lib/fluent/plugin/filter_geoip.rb +5 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2a57f588b7e2d42cbd09351534106951450cba7
|
4
|
+
data.tar.gz: 9bcad934b659525194d165664e06fa87196e9b11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddb690229c803f1ada3479f9313bd325074eabc778698e5787cf2a494839a84ac2aac0358e03880ba381366c23db89738ba644fcc23b50982ec8f890170f1db5
|
7
|
+
data.tar.gz: adef0e6bac3b902ec836335de51d85f0c97f3911fa6f6a4fe36f0da6f2a4cbee7cfa97b764c6524dc353144598c07a0d3b2c1d140451bac3d1960c9548976582
|
data/README.md
CHANGED
@@ -86,10 +86,10 @@ field_delimiter .
|
|
86
86
|
|
87
87
|
### flatten
|
88
88
|
|
89
|
-
If true, to flatten the result using field_delimiter (default:
|
89
|
+
If true, to flatten the result using field_delimiter (default: false).
|
90
90
|
|
91
91
|
```
|
92
|
-
flatten
|
92
|
+
flatten false
|
93
93
|
```
|
94
94
|
|
95
95
|
### locale
|
@@ -192,10 +192,10 @@ connection_type true
|
|
192
192
|
md5_path ./geoip/database/GeoLite2-City.md5
|
193
193
|
database_path ./geoip/database/GeoLite2-City.mmdb
|
194
194
|
|
195
|
-
lookup_field
|
195
|
+
lookup_field clientip
|
196
196
|
field_prefix geoip
|
197
197
|
field_delimiter .
|
198
|
-
flatten
|
198
|
+
flatten false
|
199
199
|
|
200
200
|
locale en
|
201
201
|
|
@@ -216,14 +216,7 @@ Assuming following inputs are coming:
|
|
216
216
|
|
217
217
|
```javascript
|
218
218
|
{
|
219
|
-
"
|
220
|
-
"user":"-",
|
221
|
-
"method":"GET",
|
222
|
-
"path":"/category/giftcards?from=20",
|
223
|
-
"code":"200",
|
224
|
-
"size":"63",
|
225
|
-
"referer":"-",
|
226
|
-
"agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
|
219
|
+
"clientip": "200.114.49.218"
|
227
220
|
}
|
228
221
|
```
|
229
222
|
|
@@ -231,35 +224,38 @@ then output bocomes as belows:
|
|
231
224
|
|
232
225
|
```javascript
|
233
226
|
{
|
234
|
-
"
|
235
|
-
"
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
227
|
+
"clientip": "200.114.49.218",
|
228
|
+
"geoip": {
|
229
|
+
"continent": {
|
230
|
+
"code": "SA",
|
231
|
+
"geoname_id": 6255150,
|
232
|
+
"name": "South America"
|
233
|
+
},
|
234
|
+
"country": {
|
235
|
+
"geoname_id": 3686110,
|
236
|
+
"iso_code": "CO",
|
237
|
+
"name": "Colombia"
|
238
|
+
},
|
239
|
+
"city": {
|
240
|
+
"geoname_id": 3674962,
|
241
|
+
"name": "Medellín"
|
242
|
+
},
|
243
|
+
"location": {
|
244
|
+
"latitude": 6.2518,
|
245
|
+
"longitude": -75.5636,
|
246
|
+
"time_zone": "America/Bogota"
|
247
|
+
},
|
248
|
+
"registered_country": {
|
249
|
+
"geoname_id": 3686110,
|
250
|
+
"iso_code": "CO",
|
251
|
+
"name": "Colombia"
|
252
|
+
},
|
253
|
+
"subdivisions": [{
|
254
|
+
"geoname_id": 3689815,
|
255
|
+
"iso_code": "ANT",
|
256
|
+
"name": "Antioquia"
|
257
|
+
}]
|
258
|
+
}
|
263
259
|
}
|
264
260
|
```
|
265
261
|
|
@@ -119,7 +119,11 @@ module Fluent
|
|
119
119
|
end
|
120
120
|
|
121
121
|
if geoip.found? then
|
122
|
-
|
122
|
+
|
123
|
+
unless @flatten then
|
124
|
+
record.merge!({@output_field => {}})
|
125
|
+
end
|
126
|
+
|
123
127
|
if @continent then
|
124
128
|
continent_hash = {}
|
125
129
|
|
@@ -348,7 +352,6 @@ module Fluent
|
|
348
352
|
if @connection_type then
|
349
353
|
unless geoip.connection_type.nil? then
|
350
354
|
if @flatten then
|
351
|
-
#record[[@output_field, 'connection_type'].join(@field_delimiter)] = geoip.connection_type
|
352
355
|
record.merge!(to_flatten(geoip.connection_type, [@output_field, 'connection_type'], @field_delimiter))
|
353
356
|
else
|
354
357
|
record[@output_field].merge!({'connection_type' => geoip.connection_type})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-filter-geoip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Minoru Osuka
|
@@ -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.5.
|
132
|
+
rubygems_version: 2.5.1
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Fluent filter plugin for adding GeoIP data to record.
|