logstash-output-coralogix 1.0.2 → 1.0.6

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
- SHA1:
3
- metadata.gz: 4d2207840796781ef249e61f3bd27d46ee91a20a
4
- data.tar.gz: 2a5066f5937197bcfa2e3b7db25296dbaaecb56a
2
+ SHA256:
3
+ metadata.gz: '0394da5f56bb7caa7818b56f6f5027f10407a417bb7b30c9b029b4c0900f6ddd'
4
+ data.tar.gz: 0e3e0ed911cb85cd3d5a020df5fed8dec949d9190bc814c133af65ba0793c27d
5
5
  SHA512:
6
- metadata.gz: a3df35e78214dd980a15404abf869b35a0afbf605dee1107dad8905215b2d1d5e11b9c1047847540c6b84ae818f48d758132ba9a25feed1c1c9f5954c545a68e
7
- data.tar.gz: 7317bd4fec3f754472ef997270bc1e34800c4506cefbb8ea817cedc2764c9cca8f1d92f2b5db5e48e7d6407658a53eed74c2084d7b9f31c73969458773ec75c8
6
+ metadata.gz: db916de2fde902b17c1c8c4ddeb25922343d79f6347a24ebf1517bf42a6d94eda4f36cfaef89ca522df616883d0b16999fcdea9a335f63793be6c1fbf0696319
7
+ data.tar.gz: b10fd96ed627cfe0a69491aab4e784ad412847ae4b85b086c587de53d70f0fcad7781d9c71f1c9c3511f1ed210264df33b8190b81ea9981ce5d468af14f09d23
@@ -3,7 +3,6 @@ require "json"
3
3
  require "date"
4
4
  require "logstash/outputs/base"
5
5
  require "logstash/namespace"
6
- require "centralized_ruby_logger"
7
6
 
8
7
  DEFAULT_APP_NAME = "FAILED_APP_NAME"
9
8
  DEFAULT_SUB_SYSTEM = "FAILED_SUB_SYSTEM_NAME"
@@ -17,6 +16,7 @@ class LogStash::Outputs::Coralogix < LogStash::Outputs::Base
17
16
  config :is_json, :validate => :boolean, :required => false
18
17
  config :force_compression, :validate => :boolean, :required => false, :default => false
19
18
  config :debug, :validate => :boolean, :required => false, :default => false
19
+ config :endpoint, :validate => :string, :required => false, :default => nil
20
20
  config :proxy, :validate => :hash, :required => false, :default => {}
21
21
  @configured = false
22
22
 
@@ -31,7 +31,7 @@ class LogStash::Outputs::Coralogix < LogStash::Outputs::Base
31
31
  logger = get_logger(record)
32
32
 
33
33
  log_record = log_key_name != nil ? record.fetch(log_key_name, record) : record
34
- log_record = is_json ? log_record.to_json : log_record
34
+ log_record = (is_json ? log_record.to_json : log_record) rescue log_record
35
35
  log_record = log_record.to_s.empty? ? record : log_record
36
36
 
37
37
  timestamp = record.fetch(timestamp_key_name, nil)
@@ -62,6 +62,15 @@ class LogStash::Outputs::Coralogix < LogStash::Outputs::Base
62
62
  def configure
63
63
  begin
64
64
  @loggers = {}
65
+
66
+ # Overwrite Coralogix endpoint
67
+ unless endpoint.nil?
68
+ ENV["CORALOGIX_LOG_URL"] = "https://#{endpoint}/api/v1/logs"
69
+ ENV["CORALOGIX_TIME_DELTA_URL"] = "https://#{endpoint}/sdk/v1/time"
70
+ end
71
+
72
+ require "centralized_ruby_logger"
73
+
65
74
  #If config parameters doesn't start with $ then we can configure Coralogix logger now.
66
75
  if !config_params["APP_NAME"].start_with?("$") && !config_params["SUB_SYSTEM"].start_with?("$")
67
76
  @logger = Coralogix::CoralogixLogger.new config_params["PRIVATE_KEY"], config_params["APP_NAME"], config_params["SUB_SYSTEM"], debug, "Logstash (#{version?})", force_compression, proxy
@@ -95,11 +104,11 @@ class LogStash::Outputs::Coralogix < LogStash::Outputs::Base
95
104
 
96
105
  def get_logger(record)
97
106
 
98
- return @logger if @configured
107
+ return @logger if @configured && !@logger.nil?
99
108
 
100
109
  app_name, sub_name = get_app_sub_name(record)
101
110
 
102
- if !@loggers.key?("#{app_name}.#{sub_name}")
111
+ if !@loggers.key?("#{app_name}.#{sub_name}") || @loggers.fetch("#{app_name}.#{sub_name}", nil).nil?
103
112
  @loggers["#{app_name}.#{sub_name}"] = Coralogix::CoralogixLogger.new config_params["PRIVATE_KEY"], app_name, sub_name, debug, "Logstash (#{version?})", force_compression, proxy
104
113
  end
105
114
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-coralogix'
3
- s.version = '1.0.2'
4
- s.date = '2019-05-22'
3
+ s.version = '1.0.6'
4
+ s.date = '2021-10-24'
5
5
  s.licenses = ['Apache-2.0']
6
6
  s.summary = 'Deliver the logs to Coralogix service.'
7
7
  s.description = 'This gem is a Logstash output plugin to deliver the logs to Coralogix service.'
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  # Gem dependencies
23
23
  s.add_runtime_dependency 'logstash-core-plugin-api', '~> 2.0'
24
24
  s.add_runtime_dependency 'logstash-codec-plain'
25
- s.add_runtime_dependency 'centralized_ruby_logger', '>= 0.0.15'
25
+ s.add_runtime_dependency 'centralized_ruby_logger', '>= 0.0.18'
26
26
 
27
27
  s.add_development_dependency 'logstash-devutils'
28
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-coralogix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coralogix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-22 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: logstash-core-plugin-api
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.15
47
+ version: 0.0.18
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.15
54
+ version: 0.0.18
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: logstash-devutils
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -102,8 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
- rubyforge_project:
106
- rubygems_version: 2.5.2.1
105
+ rubygems_version: 3.0.3
107
106
  signing_key:
108
107
  specification_version: 4
109
108
  summary: Deliver the logs to Coralogix service.