logstash-output-sumologic 1.0.4 → 1.1.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 +4 -4
- data/CHANGELOG.md +4 -22
- data/DEVELOPER.md +25 -0
- data/README.md +50 -39
- data/lib/logstash/outputs/sumologic.rb +266 -41
- data/lib/logstash/plugin_mixins/http_client.rb +187 -0
- data/logstash-output-sumologic.gemspec +5 -5
- data/spec/outputs/sumologic_spec.rb +340 -9
- data/spec/spec_helper.rb +53 -0
- metadata +31 -30
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require "logstash/devutils/rspec/spec_helper"
|
4
|
+
require "logstash/outputs/sumologic"
|
5
|
+
|
6
|
+
class Server
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@queue = Queue.new
|
10
|
+
@header = {}
|
11
|
+
end
|
12
|
+
|
13
|
+
def size
|
14
|
+
@queue.length
|
15
|
+
end
|
16
|
+
|
17
|
+
def pop
|
18
|
+
if !@queue.empty?
|
19
|
+
@queue.pop
|
20
|
+
else
|
21
|
+
puts "EMPTY"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def header
|
26
|
+
@header
|
27
|
+
end
|
28
|
+
|
29
|
+
def empty?
|
30
|
+
@queue.empty?
|
31
|
+
end
|
32
|
+
|
33
|
+
def push(data, header)
|
34
|
+
@header = header
|
35
|
+
data.split("\n").each do |line|
|
36
|
+
@queue << line
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
class LogStash::Outputs::SumoLogic
|
43
|
+
attr_reader :server
|
44
|
+
|
45
|
+
def connect
|
46
|
+
@server = Server.new
|
47
|
+
end
|
48
|
+
|
49
|
+
def send_request(content)
|
50
|
+
@server.push(content, get_headers())
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
metadata
CHANGED
@@ -1,99 +1,100 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-sumologic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sumo Logic
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: logstash-core-plugin-api
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
|
-
- - ~>
|
16
|
+
- - "~>"
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: '2.0'
|
20
|
-
|
19
|
+
name: logstash-core-plugin-api
|
21
20
|
prerelease: false
|
21
|
+
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: logstash-codec-plain
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
|
-
- -
|
30
|
+
- - "~>"
|
32
31
|
- !ruby/object:Gem::Version
|
33
32
|
version: '0'
|
34
|
-
|
33
|
+
name: logstash-codec-plain
|
35
34
|
prerelease: false
|
35
|
+
type: :runtime
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name: logstash-devutils
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
|
-
- -
|
44
|
+
- - "~>"
|
46
45
|
- !ruby/object:Gem::Version
|
47
46
|
version: '0'
|
48
|
-
|
47
|
+
name: logstash-devutils
|
49
48
|
prerelease: false
|
49
|
+
type: :development
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description: This gem is a Logstash output plugin to deliver the log to Sumo Logic
|
56
|
-
|
57
|
-
getting help, reporting issues, etc.
|
58
|
-
email: byi@sumologic.com
|
55
|
+
description: This gem is a Logstash output plugin to deliver the log or metrics to Sumo Logic cloud service. Go to https://github.com/SumoLogic/logstash-output-sumologic for getting help, reporting issues, etc.
|
56
|
+
email: 'collection@sumologic.com '
|
59
57
|
executables: []
|
60
58
|
extensions: []
|
61
59
|
extra_rdoc_files: []
|
62
60
|
files:
|
63
|
-
- lib/logstash/outputs/sumologic.rb
|
64
|
-
- spec/outputs/sumologic_spec.rb
|
65
|
-
- logstash-output-sumologic.gemspec
|
66
61
|
- CHANGELOG.md
|
67
|
-
- DEVELOPER.md
|
68
|
-
- README.md
|
69
62
|
- CONTRIBUTORS
|
63
|
+
- DEVELOPER.md
|
70
64
|
- Gemfile
|
71
65
|
- LICENSE
|
66
|
+
- README.md
|
67
|
+
- lib/logstash/outputs/sumologic.rb
|
68
|
+
- lib/logstash/plugin_mixins/http_client.rb
|
69
|
+
- logstash-output-sumologic.gemspec
|
70
|
+
- spec/outputs/sumologic_spec.rb
|
71
|
+
- spec/spec_helper.rb
|
72
72
|
homepage: https://github.com/SumoLogic/logstash-output-sumologic
|
73
73
|
licenses:
|
74
74
|
- Apache-2.0
|
75
75
|
metadata:
|
76
76
|
logstash_plugin: 'true'
|
77
77
|
logstash_group: output
|
78
|
-
post_install_message:
|
78
|
+
post_install_message:
|
79
79
|
rdoc_options: []
|
80
80
|
require_paths:
|
81
81
|
- lib
|
82
82
|
required_ruby_version: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- -
|
84
|
+
- - ">="
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: '0'
|
87
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
|
-
rubyforge_project:
|
94
|
-
rubygems_version: 2.
|
95
|
-
signing_key:
|
93
|
+
rubyforge_project:
|
94
|
+
rubygems_version: 2.6.8
|
95
|
+
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Deliever the log to Sumo Logic cloud service.
|
98
98
|
test_files:
|
99
99
|
- spec/outputs/sumologic_spec.rb
|
100
|
+
- spec/spec_helper.rb
|