fluent-plugin-coralogix 1.0.5 → 1.0.9

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
- SHA1:
3
- metadata.gz: 5e77fbb9d9a357eb434d590d1167828178a969ba
4
- data.tar.gz: 49e351ca9176671c19cd69e34bb1e3772fbd50ff
2
+ SHA256:
3
+ metadata.gz: 88a323d7812cda417a3da173fd6329eb93a63fc438c42f796724494b4965fa4e
4
+ data.tar.gz: 579ec2193693c454a2db196535f339b36f53284e14c3ccd6ab982f7302bf9569
5
5
  SHA512:
6
- metadata.gz: 0c2e97519cdd278439fffc6a44e554e9499f2a7526033e75747b1e6a81a40c7489148f07d0417ae630cda9158e9db9b23bb4e7c711c00d2716b3e90347433455
7
- data.tar.gz: 7bc70fe0c4d0aa9b9b2197ce3ddc8d4ed049e2761decbd7403b5519eca314b48ec4d962c743cd2ccd6ef5a3a55b80c064897c74f331d0fec3f445ffb44aff7b4
6
+ metadata.gz: c89474ed14bb0a7754c6424563c43d22920508f3c0bd67f0dac7090df12a9aa9755d13f653fb50235f92a67652f2b2b7ff69796b6aea85a4080d6e67be0ac037
7
+ data.tar.gz: 90bb243e415055272a01be843658c8e81b3b154efb845ed934569f71489367e45ca359818e203ff43a045aa519e688438ffd5fdc66e748eb2b85947d1b3cc50f
@@ -13,7 +13,7 @@ module Fluent
13
13
  # First, register the plugin. NAME is the name of this plugin
14
14
  # and identifies the plugin in the configuration file.
15
15
  Fluent::Plugin.register_output('coralogix', self)
16
- config_param :config, :hash, :default => {}, deprecated: "This parameter is deprecated"
16
+ config_param :endpoint, :string, :default => nil
17
17
  config_param :privatekey, :string, :default => nil
18
18
  config_param :appname, :string, :default => ""
19
19
  config_param :subsystemname, :string, :default => ""
@@ -21,7 +21,6 @@ module Fluent
21
21
  config_param :timestamp_key_name, :default => nil
22
22
  config_param :is_json, :bool, :default => false
23
23
  config_param :force_compression, :bool, :default => false
24
- config_param :debug, :bool, :default => false
25
24
  config_param :number_of_workers, :integer, :default => 1
26
25
  config_section :proxy, :param_name => "proxy", required: false, multi: false do
27
26
  config_param :host, :string
@@ -39,23 +38,28 @@ module Fluent
39
38
  @app_name_from_config = DEFAULT_appname;
40
39
  @sub_name_from_config = DEFAULT_subsystemname;
41
40
  i = 0
42
- $log.info "configure #{number_of_workers} workers"
41
+ log.info "configure #{number_of_workers} workers"
43
42
  until i == number_of_workers do
44
43
  @workers[i.to_s] = {}
45
- $log.info "init worker ##{i}"
44
+ log.info "init worker ##{i}"
46
45
  private_key = get_private_key
47
46
  if !appname.start_with?("$") && !subsystemname.start_with?("$")
48
47
  @app_name_from_config = config.fetch("APP_NAME", appname)
49
48
  @sub_name_from_config = config.fetch("SUB_SYSTEM", subsystemname)
50
- @workers[i.to_s]["#{@app_name_from_config}.#{@sub_name_from_config}"] = CoralogixLogger.new private_key, @app_name_from_config, @sub_name_from_config, debug, "FluentD (#{version?})", force_compression, proxy ? proxy.to_h.map { |k,v| [k.to_s,v] }.to_h : Hash.new
49
+ @workers[i.to_s]["#{@app_name_from_config}.#{@sub_name_from_config}"] = CoralogixLogger.new private_key, @app_name_from_config, @sub_name_from_config, false, "FluentD (#{version?})", force_compression, proxy ? proxy.to_h.map { |k,v| [k.to_s,v] }.to_h : Hash.new, log
51
50
  else
52
51
  @workers[i.to_s] = {}
53
52
  end
54
53
  i+=1
55
54
  end
56
55
 
56
+ unless endpoint.nil?
57
+ ENV["CORALOGIX_LOG_URL"] = "https://#{endpoint}/api/v1/logs"
58
+ ENV["CORALOGIX_TIME_DELTA_URL"] = "https://#{endpoint}/sdk/v1/time"
59
+ end
60
+
57
61
  rescue Exception => e
58
- $log.error "Failed to configure: #{e}"
62
+ log.error "Failed to configure: #{e}"
59
63
  end
60
64
  end
61
65
 
@@ -81,7 +85,7 @@ module Fluent
81
85
  end
82
86
  return res
83
87
  rescue Exception => e
84
- $log.error "Failed to extract #{key}: #{e}"
88
+ log.error "Failed to extract #{key}: #{e}"
85
89
  return default
86
90
  end
87
91
  end
@@ -102,13 +106,14 @@ module Fluent
102
106
  app_name, sub_name = get_app_sub_name(record)
103
107
  end
104
108
 
105
- if @currentWorker == number_of_workers
109
+ # YK@2020-11-26T10:56 - We had encountered a case in which this value reached above 7K and the value of worker became null
110
+ if @currentWorker >= number_of_workers
106
111
  @currentWorker = 0
107
112
  end
108
113
  worker = @workers[@currentWorker.to_s]
109
114
  @currentWorker+=1;
110
115
  if !worker.key?("#{app_name}.#{sub_name}")
111
- worker["#{app_name}.#{sub_name}"] = CoralogixLogger.new private_key, app_name, sub_name, debug, "FluentD (#{version?})", force_compression, proxy ? proxy.to_h.map { |k, v| [k.to_s, v] }.to_h : Hash.new
116
+ worker["#{app_name}.#{sub_name}"] = CoralogixLogger.new private_key, app_name, sub_name, false, "FluentD (#{version?})", force_compression, proxy ? proxy.to_h.map { |k, v| [k.to_s, v] }.to_h : Hash.new, log
112
117
  end
113
118
 
114
119
  return worker["#{app_name}.#{sub_name}"]
@@ -156,4 +161,4 @@ module Fluent
156
161
  }
157
162
  end
158
163
  end
159
- end
164
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-coralogix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Royee Goldberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-24 00:00:00.000000000 Z
11
+ date: 2021-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: centralized_ruby_logger
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.15
19
+ version: 0.0.18
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.15
26
+ version: 0.0.18
27
27
  description: Coralogix Fluentd plugin to send logs to Coralogix server.
28
28
  email: royee@coralogix.com
29
29
  executables: []
@@ -50,8 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  requirements: []
53
- rubyforge_project:
54
- rubygems_version: 2.6.8
53
+ rubygems_version: 3.0.3
55
54
  signing_key:
56
55
  specification_version: 4
57
56
  summary: Coralogix Fluentd out plugin