fluent-plugin-parse_request_body 0.0.18 → 0.0.19
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfda9e19224cb536d447a418b55085ff6dbb749a8d826f66a2c8a71184a5eaa1
|
4
|
+
data.tar.gz: e531755c00bbab1aa6b737cd2b7d9ab0eb4b630475024315bec19a7024415130
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f2f23612c9c93943ed4c9a76422ed51142b62c3fb2328f684c95aae11e0f43cb8b095a8a2e09f87129612357236f7ce10204164ec87cc1a9a3e5a20e25c8928
|
7
|
+
data.tar.gz: aeb97a1ca20d7c7a4f0eeb6d396dab6f84a905cefb5b29d3b089f741445cce881d06f44fe2a1ef5174eae40d73e784cbf1fbc84d01169e486195e28e58b0113f
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |gem|
|
2
2
|
gem.name = 'fluent-plugin-parse_request_body'
|
3
|
-
gem.version = '0.0.
|
3
|
+
gem.version = '0.0.19'
|
4
4
|
gem.authors = ['EkiSong']
|
5
5
|
gem.email = ['yifriday0614@gmail.com']
|
6
6
|
gem.homepage = 'https://github.com/yifriday/fluent-plugin-parse_request_body.git'
|
@@ -6,7 +6,8 @@ module Fluent::Plugin
|
|
6
6
|
class ParseRequestBodyExtractor
|
7
7
|
|
8
8
|
attr_reader :log
|
9
|
-
|
9
|
+
|
10
|
+
#初始化解析器#
|
10
11
|
def initialize(plugin, conf)
|
11
12
|
@log = plugin.log
|
12
13
|
|
@@ -16,6 +17,7 @@ module Fluent::Plugin
|
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
20
|
+
#从配置中读取配置选项#
|
19
21
|
@key = plugin.key
|
20
22
|
@only = plugin.only
|
21
23
|
@except = plugin.except
|
@@ -26,6 +28,7 @@ module Fluent::Plugin
|
|
26
28
|
@array_value_key = plugin.array_value_key
|
27
29
|
@replace_key = plugin.replace_key
|
28
30
|
|
31
|
+
#初始化白名单#
|
29
32
|
if @only
|
30
33
|
@include_keys = @only.split(/\s*,\s*/).inject({}) do |hash, i|
|
31
34
|
hash[i] = true
|
@@ -33,6 +36,7 @@ module Fluent::Plugin
|
|
33
36
|
end
|
34
37
|
end
|
35
38
|
|
39
|
+
#初始化黑名单#
|
36
40
|
if @except
|
37
41
|
@exclude_keys = @except.split(/\s*,\s*/).inject({}) do |hash, i|
|
38
42
|
hash[i] = true
|
@@ -40,6 +44,7 @@ module Fluent::Plugin
|
|
40
44
|
end
|
41
45
|
end
|
42
46
|
|
47
|
+
#初始化需要被组合的key#
|
43
48
|
if @array_value_key
|
44
49
|
if @array_value
|
45
50
|
@include_array_value = @array_value.split(/\s*,\s*/).inject({}) do |hash, i|
|
@@ -51,6 +56,7 @@ module Fluent::Plugin
|
|
51
56
|
|
52
57
|
end
|
53
58
|
|
59
|
+
#解析方法#
|
54
60
|
def add_query_params_field(record)
|
55
61
|
return record unless record[@key]
|
56
62
|
add_query_params(record[@key], record)
|
@@ -61,6 +67,7 @@ module Fluent::Plugin
|
|
61
67
|
|
62
68
|
private
|
63
69
|
|
70
|
+
#替换record中某一个键值#
|
64
71
|
def replace_record_by_key(record)
|
65
72
|
return record unless record[@replace_key]
|
66
73
|
replace_value = record[@array_value_key]
|
@@ -111,8 +118,8 @@ module Fluent::Plugin
|
|
111
118
|
record[new_key] = value
|
112
119
|
end
|
113
120
|
|
114
|
-
if @include_array_value
|
115
|
-
placeholder[placeholder.size] = value.to_f
|
121
|
+
if @include_array_value && @include_array_value.has_key?(key) && value.to_i
|
122
|
+
placeholder[placeholder.size] = value.to_f
|
116
123
|
end
|
117
124
|
end
|
118
125
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-parse_request_body
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- EkiSong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|