fluent-plugin-pi 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/fluent-plugin-pi.gemspec +1 -1
- data/lib/fluent/plugin/out_qi.rb +1 -23
- data/pkg/fluent-plugin-pi-0.0.10.gem +0 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 769099045448577ac7d1094592df62ac63d84202
|
4
|
+
data.tar.gz: 8c92eb22717f0a7f21fc1f8bc40c645e2544ea1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b5d4161a280c848963357b1e508a10cdb57e74ffcd6efa48628ffed7515338fb196a75bbe35eeb7fb34e644af8090b0d45b13abf2a1387fe6097fa374bf9549
|
7
|
+
data.tar.gz: 694426ec0522a2beaa8c23d0f9aae0e726a29c2933b3fffe29e763ca6edecf52eebb60b8b96ceaef6479719a81b04e13f4bab7480c264c5f825bf7272944a2e1
|
data/Gemfile.lock
CHANGED
data/fluent-plugin-pi.gemspec
CHANGED
data/lib/fluent/plugin/out_qi.rb
CHANGED
@@ -99,15 +99,7 @@ module Fluent
|
|
99
99
|
end
|
100
100
|
data = chunk.read
|
101
101
|
|
102
|
-
jsonObj =
|
103
|
-
|
104
|
-
if(@valuetag != nil)
|
105
|
-
jsonObj = "[" + data.chop + "]" # removes trailing ',' and makes a valid json object
|
106
|
-
else
|
107
|
-
time = Time.now.utc
|
108
|
-
jsonObj = "[{\"Timestamp\":\"#{time}\",\"Value\":\"#{data}\"}]"
|
109
|
-
end
|
110
|
-
$log.write(jsonObj)
|
102
|
+
jsonObj = "[" + data.chop + "]" # removes trailing ',' and makes a valid json object
|
111
103
|
|
112
104
|
if(Time.at(@full_token.expires_on).utc < (Time.now.utc + 30))
|
113
105
|
gettoken(false) #the refresh token isn't working so when we are withing 30 seconds get a new token
|
@@ -201,21 +193,7 @@ module Fluent
|
|
201
193
|
|
202
194
|
def format(tag, time, record)
|
203
195
|
#assumes time is a bignum in FluentD pattern not a PI Time
|
204
|
-
value = nil
|
205
|
-
if(@valuetag != nil)
|
206
196
|
value = record[@valuetag].to_s
|
207
|
-
else
|
208
|
-
$log.write("rec\n")
|
209
|
-
$log.write(record)
|
210
|
-
z = record["Value"]
|
211
|
-
$log.write("z\n")
|
212
|
-
$log.write(z)
|
213
|
-
z3 = JSON.parse(z)
|
214
|
-
$log.write("z3\n")
|
215
|
-
$log.write(z3)
|
216
|
-
z2 = z3["log"]
|
217
|
-
value = z2.to_s
|
218
|
-
end
|
219
197
|
return "{\"Timestamp\":\"#{Time.at(time).localtime}\",\"Value\":\"#{value}\"},"
|
220
198
|
end
|
221
199
|
end
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-pi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derek Endres
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- lib/fluent/plugin/out_pi.rb
|
99
99
|
- lib/fluent/plugin/out_qi.rb
|
100
100
|
- pkg/fluent-plugin-pi-0.0.1.gem
|
101
|
+
- pkg/fluent-plugin-pi-0.0.10.gem
|
101
102
|
- pkg/fluent-plugin-pi-0.0.2.gem
|
102
103
|
- pkg/fluent-plugin-pi-0.0.3.gem
|
103
104
|
- pkg/fluent-plugin-pi-0.0.4.gem
|