logstash-output-coralogix_logger 0.6.0 → 0.7.0

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: 40684170b5a45fa2cf24abb3c4bb73a0b09f869d
4
- data.tar.gz: 788b3e3c62aa33c794e62ac48ed82a4e593f26e8
3
+ metadata.gz: 7309c9ca8f70354caf105f9b272e2b036f8c06ef
4
+ data.tar.gz: f6153936545d1cf1aa255c8aac1982c96a0a1e0b
5
5
  SHA512:
6
- metadata.gz: 398c1430095dc4ee264bd33ffb1d06e3a0f81a1e3861b26602b8b5d78e6921f7033e0d82ce6b510741d2752ac2dd01e79a251090911f5c89b736f2f0b58ed21f
7
- data.tar.gz: c49830c484b9dc760975af328e14a442ca804d3a96a96a198dacfa73f9ce812e551ac4481fc0b03c4ce420b33f255571454044771ff5d8d849be231722c906d2
6
+ metadata.gz: 57ebdf69283293888d78f6c488051100cf729dd10dc00e280ef61ea662e502a6d6edb5215ebfee7fece40fa8cc02191e9061342d1e59bcc12cecb382d4657e2c
7
+ data.tar.gz: 8d2cb102775462ff5daaf791cfad7ae672946a7cf20df74529afa4dd97c98ad9969a84f7c43fb1bf6619201066a1d8e02b6c96dd824e32caa04bf20ad42d30f2
@@ -12,7 +12,7 @@ class LogStash::Outputs::CoralogixLogger < LogStash::Outputs::Base
12
12
  concurrency :single
13
13
  config :config_params, :validate => :hash, :required => true
14
14
  config :log_key_name, :validate => :string, :required => false
15
- config :is_json, :validate => :bool, :required => false
15
+ config :is_json, :validate => :boolean, :required => false
16
16
  @configured = false
17
17
 
18
18
  public
@@ -38,6 +38,14 @@ class LogStash::Outputs::CoralogixLogger < LogStash::Outputs::Base
38
38
  return 1
39
39
  end # def event
40
40
 
41
+ def version?
42
+ begin
43
+ Gem.loaded_specs['logstash-output-coralogix_logger'].version.to_s
44
+ rescue Exception => e
45
+ $stderr.write e
46
+ return '0.0.0'
47
+ end
48
+ end
41
49
 
42
50
  # This method is called before starting.
43
51
  def configure
@@ -45,11 +53,11 @@ class LogStash::Outputs::CoralogixLogger < LogStash::Outputs::Base
45
53
  @loggers = {}
46
54
  #If config parameters doesn't start with $ then we can configure Coralogix logger now.
47
55
  if !config_params["APP_NAME"].start_with?("$") && !config_params["SUB_SYSTEM"].start_with?("$")
48
- @logger = Coralogix::CoralogixLogger.new config_params["PRIVATE_KEY"], config_params["APP_NAME"], config_params["SUB_SYSTEM"], false, "Logstash"
56
+ @logger = Coralogix::CoralogixLogger.new config_params["PRIVATE_KEY"], config_params["APP_NAME"], config_params["SUB_SYSTEM"], false, "Logstash (#{version?})"
49
57
  @configured = true
50
58
  end
51
59
  rescue Exception => e
52
- $stdout.write "Failed to configure: #{e}"
60
+ $stderr.write "Failed to configure: #{e}"
53
61
  end
54
62
  end
55
63
 
@@ -63,7 +71,7 @@ class LogStash::Outputs::CoralogixLogger < LogStash::Outputs::Base
63
71
  end
64
72
  return res
65
73
  rescue Exception => e
66
- $stdout.write "Failed to extract #{key}: #{e}"
74
+ $stderr.write "Failed to extract #{key}: #{e}"
67
75
  return default
68
76
  end
69
77
  end
@@ -82,7 +90,7 @@ class LogStash::Outputs::CoralogixLogger < LogStash::Outputs::Base
82
90
  app_name, sub_name = get_app_sub_name(record)
83
91
 
84
92
  if !@loggers.key?("#{app_name}.#{sub_name}")
85
- @loggers["#{app_name}.#{sub_name}"] = Coralogix::CoralogixLogger.new config_params["PRIVATE_KEY"], app_name, sub_name, false, "Logstash"
93
+ @loggers["#{app_name}.#{sub_name}"] = Coralogix::CoralogixLogger.new config_params["PRIVATE_KEY"], app_name, sub_name, false, "Logstash (#{version?})"
86
94
  end
87
95
 
88
96
  return @loggers["#{app_name}.#{sub_name}"]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-coralogix_logger'
3
- s.version = '0.6.0'
3
+ s.version = '0.7.0'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = 'Coralogix Logstash logger SDK'
6
6
  s.description = 'Coralogix Logstash logger to send logs to Coralogix server'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-coralogix_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Royee Goldberg