logstash-output-thinkingdata 1.0.1 → 1.1.0

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: ca56f25a56609a0ba791c30b03f9f3f2cff37d09c7ae7f708e16c43550b00f68
4
- data.tar.gz: 3fda7fe64d91e3d9d889802d9fea3badc1c604bcbccb6c47c021cfd5d802ae5e
3
+ metadata.gz: d03c9bd2f5bfd3a753641b13e92cc69607c2490ec79638fe647c3d50fbc84a39
4
+ data.tar.gz: 1563128b58ad6911ff6e31e3620163d6dbdc13d5b1d12fccf2a5206463ad006b
5
5
  SHA512:
6
- metadata.gz: fe27486b4018eb88f8213bd652d19820bbdaf2d1dbfeecb6341a03537a421b666c4efff7dad8bec194067174150f56f385deec77c2cb00c3f82721c6fd5fc531
7
- data.tar.gz: 2e574076f997d2d0af39222558930956443acc742929b4f142547192bb9d4f51f3707debba8d6530cb6115bd736c1930d8d641af8c783b9d0fb5f3ce36fe8266
6
+ metadata.gz: 487f7a87e25265510a05e15266ceae5cecc3e1d184afc128b17fff18ef6d66d6ce1621164eb51eedbb678fc6d40da0c0c02059cf3ffee2cef79c2136e54c1efa
7
+ data.tar.gz: a8626d2c8a7f289081c50905ce09cd9b97e4eba4152c364cfc00403e70d9f1324c274cb2f505c0f9e78aef185eb52e92474ff15324cf26848fa3c0eed9978468
@@ -1,3 +1,6 @@
1
+ **v1.1.0** (2021-01-27)
2
+ - 增加支持数据中的#app_id的格式
3
+
1
4
  **v1.0.1** (2020-12-21)
2
5
  - 修复浮点数转化为科学计数法的问题
3
6
 
@@ -24,9 +24,6 @@ class LogStash::Outputs::Thinkingdata < LogStash::Outputs::Base
24
24
  # 数据的项目appid
25
25
  config :appid, :validate => :string
26
26
 
27
- # 是否将appid封装于数据中
28
- config :is_sync_data, :validate => :boolean, :default => false
29
-
30
27
  # 触发 flush 间隔时间
31
28
  config :flush_interval_sec, :validate => :number, :default => 2
32
29
 
@@ -45,7 +42,7 @@ class LogStash::Outputs::Thinkingdata < LogStash::Outputs::Base
45
42
  # 是否检测appid
46
43
  config :appid_check, :validate => :boolean, :default => false
47
44
 
48
- PLUGIN_VERSION = "1.0.1"
45
+ PLUGIN_VERSION = "1.1.0"
49
46
 
50
47
  public
51
48
 
@@ -53,7 +50,6 @@ class LogStash::Outputs::Thinkingdata < LogStash::Outputs::Base
53
50
  @logger.info("Registering thinkingdata Output",
54
51
  :url => @url,
55
52
  :appid => @appid,
56
- :is_sync_data => @is_sync_data,
57
53
  :flush_interval_sec => @flush_interval_sec,
58
54
  :flush_batch_size => @flush_batch_size,
59
55
  :compress => @compress,
@@ -65,7 +61,7 @@ class LogStash::Outputs::Thinkingdata < LogStash::Outputs::Base
65
61
  http_client_config = client_config
66
62
  http_client_config[:user_agent] = "thinkingdata_logstash_output_plugin_" + PLUGIN_VERSION
67
63
  @client = Manticore::Client.new(http_client_config)
68
- ta_appid_check if @appid_check
64
+ ta_appid_check if @appid_check && !@appid.nil? && !@appid.empty?
69
65
  @receive_count = 0
70
66
  @parse_error_count = 0
71
67
  @last_report_count = 0
@@ -156,8 +152,16 @@ class LogStash::Outputs::Thinkingdata < LogStash::Outputs::Base
156
152
  data = gz.string
157
153
  compress_type = 'gzip'
158
154
  end
159
- headers = {'appid' => @appid, 'version' => PLUGIN_VERSION, 'user-agent' => 'logstash_' + PLUGIN_VERSION,
160
- 'compress' => compress_type}
155
+ if @appid.nil? || @appid.empty?
156
+ headers = {'custom_appid' => 'true', 'version' => PLUGIN_VERSION, 'user-agent' => 'logstash_' + PLUGIN_VERSION,
157
+ 'compress' => compress_type, 'TA-Integration-Type' => 'logstash',
158
+ 'TA-Integration-Version' => PLUGIN_VERSION, 'TA-Integration-Count' => events.length.to_s}
159
+ else
160
+ headers = {'appid' => @appid, 'version' => PLUGIN_VERSION, 'user-agent' => 'logstash_' + PLUGIN_VERSION,
161
+ 'compress' => compress_type, 'TA-Integration-Type' => 'logstash',
162
+ 'TA-Integration-Version' => PLUGIN_VERSION, 'TA-Integration-Count' => events.length.to_s}
163
+ end
164
+
161
165
  until do_send(data, headers)
162
166
  sleep 5
163
167
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-thinkingdata'
3
- s.version = '1.0.1'
3
+ s.version = '1.1.0'
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.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sdk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-21 00:00:00.000000000 Z
11
+ date: 2021-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core-plugin-api