logstash-output-thinkingdata 1.1.0 → 1.1.1

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
  SHA256:
3
- metadata.gz: d03c9bd2f5bfd3a753641b13e92cc69607c2490ec79638fe647c3d50fbc84a39
4
- data.tar.gz: 1563128b58ad6911ff6e31e3620163d6dbdc13d5b1d12fccf2a5206463ad006b
3
+ metadata.gz: 36f24c7196c243ee0ec3df9f446f98e60c48d860e6404d6e38897ba2841a99fb
4
+ data.tar.gz: 9b9fbb9076a958cda52e69775bf23fdfd947c6925ede50cdd86f6d8138f58a2c
5
5
  SHA512:
6
- metadata.gz: 487f7a87e25265510a05e15266ceae5cecc3e1d184afc128b17fff18ef6d66d6ce1621164eb51eedbb678fc6d40da0c0c02059cf3ffee2cef79c2136e54c1efa
7
- data.tar.gz: a8626d2c8a7f289081c50905ce09cd9b97e4eba4152c364cfc00403e70d9f1324c274cb2f505c0f9e78aef185eb52e92474ff15324cf26848fa3c0eed9978468
6
+ metadata.gz: 2cc68f4e54b11095e2226772967499e4097175a0d4647f32b02eda64b6f5ecfb29f15d7d6e500b6cf92f903e914bdb7880611f713882e7b4a34e7347432a3f19
7
+ data.tar.gz: d60a81599ec0cf34c697676a85ed6d249e5de8f8d3da74adf6afcdaa42bf01b7e6038d08d8de990478872c023db548df1bafacc243d7c9133e0b9a408cbcf056
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ **v1.1.1** (2021-07-10)
2
+ - 增加json格式校验
3
+
1
4
  **v1.1.0** (2021-01-27)
2
5
  - 增加支持数据中的#app_id的格式
3
6
 
@@ -42,7 +42,7 @@ class LogStash::Outputs::Thinkingdata < LogStash::Outputs::Base
42
42
  # 是否检测appid
43
43
  config :appid_check, :validate => :boolean, :default => false
44
44
 
45
- PLUGIN_VERSION = "1.1.0"
45
+ PLUGIN_VERSION = "1.1.1"
46
46
 
47
47
  public
48
48
 
@@ -140,14 +140,15 @@ class LogStash::Outputs::Thinkingdata < LogStash::Outputs::Base
140
140
  public
141
141
 
142
142
  def flush(events, final)
143
+ events = data_valid(events)
144
+ data = events.to_json
143
145
  if @compress == 0
144
- data = events.to_json
145
146
  compress_type = 'none'
146
147
  else
147
148
  gz = StringIO.new("w")
148
149
  gz.set_encoding("BINARY")
149
150
  z = Zlib::GzipWriter.new(gz)
150
- z.write(events.to_json)
151
+ z.write(data)
151
152
  z.close
152
153
  data = gz.string
153
154
  compress_type = 'gzip'
@@ -233,6 +234,22 @@ class LogStash::Outputs::Thinkingdata < LogStash::Outputs::Base
233
234
  result
234
235
  end
235
236
 
237
+ private
238
+
239
+ def data_valid(events)
240
+ result = []
241
+ events.each do |event|
242
+ begin
243
+ event.to_json
244
+ result << event
245
+ rescue => e
246
+ @logger.error("Could not parse events", :content => event.to_s, :Exception => e)
247
+ @parse_error_count += 1
248
+ end
249
+ end
250
+ return result
251
+ end
252
+
236
253
  end
237
254
 
238
255
  # class LogStash::Outputs::Thinkingdata
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-thinkingdata'
3
- s.version = '1.1.0'
3
+ s.version = '1.1.1'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = 'Output plugin for Thinkingdata Analytics'
6
6
  s.description = 'This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-thinkingdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sdk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-27 00:00:00.000000000 Z
11
+ date: 2021-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core-plugin-api