fluent-plugin-pi 0.0.10 → 0.0.11

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
  SHA1:
3
- metadata.gz: c2e05831072e5314224a5a9976adb24163b3a2ff
4
- data.tar.gz: e7e5c80bceaa3f91d527016fa9f70b6c5cccaa92
3
+ metadata.gz: 769099045448577ac7d1094592df62ac63d84202
4
+ data.tar.gz: 8c92eb22717f0a7f21fc1f8bc40c645e2544ea1e
5
5
  SHA512:
6
- metadata.gz: a338aa2f58e0831c3e2b98268b472180852e1d69668d2919ff2c41a97ea29497036a71c2a4968d434286bcc0ede5a763fc66bc14ab97a9cbb24c62d0ec84092d
7
- data.tar.gz: 7a43d6cf07420e88c0492bfe9778b5100e0f7800ddb1b8447cf58b1b899baa2e1dd18d8019eb6c5342e18652500f6d6fb88e951127607c0e4ef5e44b74b49a59
6
+ metadata.gz: 8b5d4161a280c848963357b1e508a10cdb57e74ffcd6efa48628ffed7515338fb196a75bbe35eeb7fb34e644af8090b0d45b13abf2a1387fe6097fa374bf9549
7
+ data.tar.gz: 694426ec0522a2beaa8c23d0f9aae0e726a29c2933b3fffe29e763ca6edecf52eebb60b8b96ceaef6479719a81b04e13f4bab7480c264c5f825bf7272944a2e1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-pi (0.0.10)
4
+ fluent-plugin-pi (0.0.11)
5
5
  adal (~> 1.0.0)
6
6
  certified (~> 1.0.0)
7
7
  rest-client (~> 1.6.9)
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "fluent-plugin-pi"
6
- spec.version = "0.0.10"
6
+ spec.version = "0.0.11"
7
7
  spec.authors = ["Derek Endres"]
8
8
  spec.email = ["dendres@osisoft.com"]
9
9
 
@@ -99,15 +99,7 @@ module Fluent
99
99
  end
100
100
  data = chunk.read
101
101
 
102
- jsonObj = nil
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
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.10
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