logstash-output-kusto 1.0.5-java → 1.0.6-java
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 +4 -4
- data/CHANGELOG.md +36 -36
- data/CONTRIBUTORS +10 -10
- data/Gemfile +22 -22
- data/LICENSE +201 -201
- data/README.md +94 -94
- data/SECURITY.md +41 -41
- data/lib/com/fasterxml/jackson/core/jackson-annotations/2.12.5/jackson-annotations-2.12.5.jar +0 -0
- data/lib/com/fasterxml/jackson/core/jackson-core/2.12.5/jackson-core-2.12.5.jar +0 -0
- data/lib/com/fasterxml/jackson/core/jackson-databind/2.12.5/jackson-databind-2.12.5.jar +0 -0
- data/lib/com/microsoft/azure/kusto/kusto-data/3.1.1/kusto-data-3.1.1.jar +0 -0
- data/lib/com/microsoft/azure/kusto/kusto-data/3.2.1/kusto-data-3.2.1.jar +0 -0
- data/lib/com/microsoft/azure/kusto/kusto-ingest/3.1.1/kusto-ingest-3.1.1.jar +0 -0
- data/lib/com/microsoft/azure/kusto/kusto-ingest/3.2.1/kusto-ingest-3.2.1.jar +0 -0
- data/lib/logstash/outputs/kusto/ingestor.rb +138 -138
- data/lib/logstash/outputs/kusto/interval.rb +81 -81
- data/lib/logstash/outputs/kusto.rb +422 -422
- data/lib/logstash-output-kusto_jars.rb +12 -12
- data/lib/org/apache/commons/commons-text/1.10.0/commons-text-1.10.0.jar +0 -0
- data/logstash-output-kusto.gemspec +36 -36
- data/spec/outputs/kusto/ingestor_spec.rb +121 -121
- data/spec/outputs/kusto_spec.rb +56 -56
- data/spec/spec_helpers.rb +21 -21
- metadata +21 -13
@@ -1,81 +1,81 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'logstash/outputs/base'
|
4
|
-
require 'logstash/namespace'
|
5
|
-
require 'logstash/errors'
|
6
|
-
|
7
|
-
class LogStash::Outputs::Kusto < LogStash::Outputs::Base
|
8
|
-
##
|
9
|
-
# Bare-bones utility for running a block of code at an interval.
|
10
|
-
#
|
11
|
-
class Interval
|
12
|
-
##
|
13
|
-
# Initializes a new Interval with the given arguments and starts it
|
14
|
-
# before returning it.
|
15
|
-
#
|
16
|
-
# @param interval [Integer] (see: Interval#initialize)
|
17
|
-
# @param procsy [#call] (see: Interval#initialize)
|
18
|
-
#
|
19
|
-
# @return [Interval]
|
20
|
-
#
|
21
|
-
def self.start(interval, procsy)
|
22
|
-
new(interval, procsy).tap(&:start)
|
23
|
-
end
|
24
|
-
|
25
|
-
##
|
26
|
-
# @param interval [Integer]: time in seconds to wait between calling the given proc
|
27
|
-
# @param procsy [#call]: proc or lambda to call periodically; must not raise exceptions.
|
28
|
-
def initialize(interval, procsy)
|
29
|
-
@interval = interval
|
30
|
-
@procsy = procsy
|
31
|
-
|
32
|
-
# Mutex, ConditionVariable, etc.
|
33
|
-
@mutex = Mutex.new
|
34
|
-
@sleeper = ConditionVariable.new
|
35
|
-
end
|
36
|
-
|
37
|
-
##
|
38
|
-
# Starts the interval, or returns if it has already been started.
|
39
|
-
#
|
40
|
-
# @return [void]
|
41
|
-
def start
|
42
|
-
@mutex.synchronize do
|
43
|
-
return if @thread && @thread.alive?
|
44
|
-
|
45
|
-
@thread = Thread.new { run }
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
##
|
50
|
-
# Stop the interval.
|
51
|
-
# Does not interrupt if execution is in-progress.
|
52
|
-
def stop
|
53
|
-
@mutex.synchronize do
|
54
|
-
@stopped = true
|
55
|
-
end
|
56
|
-
|
57
|
-
@thread && @thread.join
|
58
|
-
end
|
59
|
-
|
60
|
-
##
|
61
|
-
# @return [Boolean]
|
62
|
-
def alive?
|
63
|
-
@thread && @thread.alive?
|
64
|
-
end
|
65
|
-
|
66
|
-
private
|
67
|
-
|
68
|
-
def run
|
69
|
-
@mutex.synchronize do
|
70
|
-
loop do
|
71
|
-
@sleeper.wait(@mutex, @interval)
|
72
|
-
break if @stopped
|
73
|
-
|
74
|
-
@procsy.call
|
75
|
-
end
|
76
|
-
end
|
77
|
-
ensure
|
78
|
-
@sleeper.broadcast
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'logstash/outputs/base'
|
4
|
+
require 'logstash/namespace'
|
5
|
+
require 'logstash/errors'
|
6
|
+
|
7
|
+
class LogStash::Outputs::Kusto < LogStash::Outputs::Base
|
8
|
+
##
|
9
|
+
# Bare-bones utility for running a block of code at an interval.
|
10
|
+
#
|
11
|
+
class Interval
|
12
|
+
##
|
13
|
+
# Initializes a new Interval with the given arguments and starts it
|
14
|
+
# before returning it.
|
15
|
+
#
|
16
|
+
# @param interval [Integer] (see: Interval#initialize)
|
17
|
+
# @param procsy [#call] (see: Interval#initialize)
|
18
|
+
#
|
19
|
+
# @return [Interval]
|
20
|
+
#
|
21
|
+
def self.start(interval, procsy)
|
22
|
+
new(interval, procsy).tap(&:start)
|
23
|
+
end
|
24
|
+
|
25
|
+
##
|
26
|
+
# @param interval [Integer]: time in seconds to wait between calling the given proc
|
27
|
+
# @param procsy [#call]: proc or lambda to call periodically; must not raise exceptions.
|
28
|
+
def initialize(interval, procsy)
|
29
|
+
@interval = interval
|
30
|
+
@procsy = procsy
|
31
|
+
|
32
|
+
# Mutex, ConditionVariable, etc.
|
33
|
+
@mutex = Mutex.new
|
34
|
+
@sleeper = ConditionVariable.new
|
35
|
+
end
|
36
|
+
|
37
|
+
##
|
38
|
+
# Starts the interval, or returns if it has already been started.
|
39
|
+
#
|
40
|
+
# @return [void]
|
41
|
+
def start
|
42
|
+
@mutex.synchronize do
|
43
|
+
return if @thread && @thread.alive?
|
44
|
+
|
45
|
+
@thread = Thread.new { run }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
##
|
50
|
+
# Stop the interval.
|
51
|
+
# Does not interrupt if execution is in-progress.
|
52
|
+
def stop
|
53
|
+
@mutex.synchronize do
|
54
|
+
@stopped = true
|
55
|
+
end
|
56
|
+
|
57
|
+
@thread && @thread.join
|
58
|
+
end
|
59
|
+
|
60
|
+
##
|
61
|
+
# @return [Boolean]
|
62
|
+
def alive?
|
63
|
+
@thread && @thread.alive?
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
|
68
|
+
def run
|
69
|
+
@mutex.synchronize do
|
70
|
+
loop do
|
71
|
+
@sleeper.wait(@mutex, @interval)
|
72
|
+
break if @stopped
|
73
|
+
|
74
|
+
@procsy.call
|
75
|
+
end
|
76
|
+
end
|
77
|
+
ensure
|
78
|
+
@sleeper.broadcast
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|