fluent-plugin-light-core 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-light-core.gemspec +1 -1
- data/lib/fluent/plugin/filter_light_core.rb +12 -5
- data/sample/README.md +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84773035328d3e9f94b3a41242a24038c9f00bf84ff4e4c282ac67d44fa75350
|
4
|
+
data.tar.gz: 393720c2ce0fc4d55fabf7e9206ab57bf8085c0df9c5e043356cc87f356328c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eca26afd55eb797b228c2cf65653882d31718c66630041ab05243c5be3d1b85f995a8dca5c8e6cd79971cb4db5735cd2d49ccb8f0e4c9357117e90252fae81ea
|
7
|
+
data.tar.gz: 8faa457619809fe3b26db9658fdf5dc66a960477541bc9ac7342b21612eb649743ec99be49ba1584e01fb8e615cd97f94dc9be9303d01fe222ed5ac654665226
|
@@ -127,9 +127,9 @@ module Fluent
|
|
127
127
|
record['method'] = item[:method]
|
128
128
|
record['url'] = item[:url]
|
129
129
|
record['status'] = item[:status]
|
130
|
-
record['size'] = item[:size]
|
130
|
+
record['size'] = format_str(item[:size])
|
131
131
|
record['uid'] = item[:uid]
|
132
|
-
record['elapsed'] = item[:elapsed]
|
132
|
+
record['elapsed'] = format_str(item[:elapsed])
|
133
133
|
record['addr'] = item[:addr].gsub(/\n$/, '')
|
134
134
|
|
135
135
|
return record
|
@@ -166,11 +166,11 @@ module Fluent
|
|
166
166
|
record['method'] = item[:method]
|
167
167
|
record['path'] = item[:path]
|
168
168
|
record['code'] = item[:code]
|
169
|
-
record['size'] = item[:size]
|
169
|
+
record['size'] = format_str(item[:size])
|
170
170
|
record['referer'] = item[:referer]
|
171
171
|
record['agent'] = item[:agent]
|
172
172
|
record['forwarder'] = item[:forwarder]
|
173
|
-
record['elapsed'] = item[:elapsed]
|
173
|
+
record['elapsed'] = format_str(item[:elapsed])
|
174
174
|
|
175
175
|
return record
|
176
176
|
end
|
@@ -235,7 +235,7 @@ module Fluent
|
|
235
235
|
end
|
236
236
|
|
237
237
|
if item[:querytime]
|
238
|
-
record['querytime'] = item[:querytime]
|
238
|
+
record['querytime'] = format_str(item[:querytime])
|
239
239
|
end
|
240
240
|
|
241
241
|
if item[:query]
|
@@ -331,6 +331,13 @@ module Fluent
|
|
331
331
|
@udp.send(data.to_json, 0, Socket.pack_sockaddr_in(@port, @host))
|
332
332
|
end
|
333
333
|
|
334
|
+
# 转数字
|
335
|
+
def format_str(str)
|
336
|
+
return str.to_i if (str =~ /^\d+$/)
|
337
|
+
return str.to_f if (str =~ /^\d+\.\d+$/)
|
338
|
+
str
|
339
|
+
end
|
340
|
+
|
334
341
|
end
|
335
342
|
end
|
336
343
|
end
|
data/sample/README.md
CHANGED
@@ -21,7 +21,10 @@ Initialized empty Git repository in /Users/lilin/developer/light/fluent-plugin-l
|
|
21
21
|
% gem signin
|
22
22
|
|
23
23
|
- 发布
|
24
|
-
|
24
|
+
1. 删除pkg目录下的所有内容
|
25
|
+
2. 修改 fluent-plugin-light-core.gemspec 中的 spec.version
|
26
|
+
3. 提交所有的修改
|
27
|
+
4. 执行打包发布 $ rake release
|
25
28
|
|
26
29
|
|
27
30
|
## 调试
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-light-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LIN LI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|