fluent-plugin-decode_location 0.0.1 → 0.0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4000d3f3de2940e56bdd3ada17a2ec58ac4fb9d
|
4
|
+
data.tar.gz: 2e96f1ca0f3a01898d70247b8546d6a0b25a7fc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0540dcb543acb2c4508b6fc9b90e1ccb1cd3e590acfa8a763a9299bd68d2c0723bbf3b096242d336b2d4bbd1074765e41dc9ac98185c292af6550a1ee5c85842
|
7
|
+
data.tar.gz: 63f91c13032be0a7ff917265b0043e1f88d944982f4450025edd05a4ec35c873a84bb9172e4a63e7c5f7f100380a4306905681b8f64947fd83b757d87c8e0c5e
|
data/CHANGELOG.md
CHANGED
@@ -50,15 +50,15 @@ module Fluent
|
|
50
50
|
source = record
|
51
51
|
|
52
52
|
key.split('.').each do |v|
|
53
|
-
if source[v.to_sym]
|
54
|
-
source = source[v.to_sym]
|
55
|
-
else
|
53
|
+
if source[v] || source[v.to_sym]
|
54
|
+
source = source[v] ? source[v] : source[v.to_sym]
|
55
|
+
else
|
56
56
|
record['break'] = true
|
57
57
|
source = nil
|
58
58
|
break
|
59
59
|
end
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
if source
|
63
63
|
hash = {}
|
64
64
|
city = ''
|
@@ -67,6 +67,11 @@ module Fluent
|
|
67
67
|
exploded = source.split(":|")
|
68
68
|
source = exploded[0]
|
69
69
|
city = exploded[1]
|
70
|
+
|
71
|
+
if city.is_a?(String)
|
72
|
+
city = Base64.decode64(city)
|
73
|
+
city.force_encoding('utf-8')
|
74
|
+
end
|
70
75
|
end
|
71
76
|
|
72
77
|
array = source.to_i.base62_encode.gsub(SEPARATOR_DASH, '-').gsub(SEPARATOR_DOT, '.').split(SEPARATOR)
|
@@ -76,7 +81,7 @@ module Fluent
|
|
76
81
|
hash['continent'] = array[2] ? array[2] : ''
|
77
82
|
hash['countryCode'] = array[3] ? array[3] : ''
|
78
83
|
hash['province'] = array[4] ? array[4] : ''
|
79
|
-
hash['city'] = city
|
84
|
+
hash['city'] = city
|
80
85
|
|
81
86
|
target = sub_key ? (record[sub_key] ||= {}) : record
|
82
87
|
|
@@ -86,5 +91,6 @@ module Fluent
|
|
86
91
|
rescue => e
|
87
92
|
log.warn("out_decode_location: error_class:#{e.class} error_message:#{e.message} tag:#{tag} record:#{record} bactrace:#{e.backtrace.first}")
|
88
93
|
end
|
94
|
+
|
89
95
|
end
|
90
96
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-decode_location
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- L. Srednicki
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: base62
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|