logstash-output-coralogix_logger 0.19.0 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/outputs/coralogix_logger.rb +15 -2
- data/logstash-output-coralogix-logger.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1160b7615c75971d112aa0eb160e66c6b765575
|
4
|
+
data.tar.gz: 7249b739cd0d57fca278967ff32f7aca6cef7adb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b192a2d6e395ace7b64aac2409c912f249578de1645eeae58c307b73d5b95d0fc8f9f73a28b7d8196f6f1cd69b2a91e154980b414a4b37ae51df5b29cbf4f9a
|
7
|
+
data.tar.gz: d2e1be9762919aafb47ede750bd8cc8570497304dd8e7fac2754b372b68e357ee41789bdd3285e315251daf9ef54dd13faee1f331f0b37f57ff0681020164996
|
@@ -3,6 +3,7 @@ require "logstash/outputs/base"
|
|
3
3
|
require "logstash/namespace"
|
4
4
|
require 'centralized_ruby_logger'
|
5
5
|
require 'json'
|
6
|
+
require 'date'
|
6
7
|
|
7
8
|
DEFAULT_APP_NAME = "FAILED_APP_NAME"
|
8
9
|
DEFAULT_SUB_SYSTEM = "FAILED_SUB_SYSTEM_NAME"
|
@@ -11,6 +12,7 @@ class LogStash::Outputs::CoralogixLogger < LogStash::Outputs::Base
|
|
11
12
|
config_name "coralogix_logger"
|
12
13
|
concurrency :shared
|
13
14
|
config :config_params, :validate => :hash, :required => true
|
15
|
+
config :timestamp_key_name, :validate => :string, :required => false
|
14
16
|
config :log_key_name, :validate => :string, :required => false
|
15
17
|
config :is_json, :validate => :boolean, :required => false
|
16
18
|
config :debug, :validate => :boolean, :required => false, :default => false
|
@@ -33,14 +35,25 @@ class LogStash::Outputs::CoralogixLogger < LogStash::Outputs::Base
|
|
33
35
|
end
|
34
36
|
|
35
37
|
logger = get_logger(record)
|
36
|
-
|
38
|
+
|
37
39
|
log_record = log_key_name != nil ? record.fetch(log_key_name, record) : record
|
38
40
|
|
39
41
|
log_record = (is_json && record[temp_key] != nil) ? log_record.to_json : log_record
|
40
42
|
|
41
43
|
log_record = (log_record == nil || log_record.to_s.empty?) ? record : log_record
|
42
44
|
|
43
|
-
|
45
|
+
timestamp = record.fetch(timestamp_key_name, nil)
|
46
|
+
|
47
|
+
if(timestamp.nil?)
|
48
|
+
logger.debug log_record
|
49
|
+
else
|
50
|
+
begin
|
51
|
+
float_timestamp = DateTime.parse(timestamp).to_time.to_f * 1000
|
52
|
+
logger.debug log_record, nil, timestamp:float_timestamp
|
53
|
+
rescue Exception => e
|
54
|
+
logger.debug log_record
|
55
|
+
end
|
56
|
+
end
|
44
57
|
end
|
45
58
|
|
46
59
|
return 1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-coralogix_logger'
|
3
|
-
s.version = '0.
|
3
|
+
s.version = '0.20.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'
|
@@ -21,6 +21,6 @@ Gem::Specification.new do |s|
|
|
21
21
|
#s.add_dependency 'centralized_ruby_logger'
|
22
22
|
s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
|
23
23
|
s.add_runtime_dependency "logstash-codec-plain"
|
24
|
-
s.add_runtime_dependency "centralized_ruby_logger", ">= 0.0.
|
24
|
+
s.add_runtime_dependency "centralized_ruby_logger", ">= 0.0.9"
|
25
25
|
s.add_development_dependency "logstash-devutils"
|
26
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-coralogix_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Royee Goldberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-17 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.
|
47
|
+
version: 0.0.9
|
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.
|
54
|
+
version: 0.0.9
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: logstash-devutils
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project:
|
106
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.5.2
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Coralogix Logstash logger SDK
|