fluent-plugin-splunkhec 1.6 → 1.7
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/.travis.yml +5 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +62 -0
- data/fluent-plugin-splunkhec.gemspec +1 -1
- data/lib/fluent/plugin/out_splunkhec.rb +4 -7
- data/test/plugin/test_out_splunkhec.rb +4 -4
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64bafb9078216f8761e88b562441c73861fa0b20
|
4
|
+
data.tar.gz: 79933b686c1619ac6ddd79789df0034fd2ec8403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89d43832331ea520882e0129cddaea6942a0cc1c9453d3a4ea6997d174f47791f86663797c8966cdcf1785b370354f12945ead0933c02fbaedda34c551cefa0b
|
7
|
+
data.tar.gz: 9ffe57c6011cdf2a349695a05534513c2d216eba7e984a6d980ab43a63cfd79825bf48ed11877aa3d265d18a3abe48435faba86d6ccbe222245885d21c197545
|
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
fluent-plugin-splunkhec (1.5)
|
5
|
+
fluentd (>= 0.10.58, < 2)
|
6
|
+
yajl-ruby (>= 1.3.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
addressable (2.5.2)
|
12
|
+
public_suffix (>= 2.0.2, < 4.0)
|
13
|
+
cool.io (1.5.3)
|
14
|
+
crack (0.4.3)
|
15
|
+
safe_yaml (~> 1.0.0)
|
16
|
+
dig_rb (1.0.1)
|
17
|
+
fluentd (1.2.0)
|
18
|
+
cool.io (>= 1.4.5, < 2.0.0)
|
19
|
+
dig_rb (~> 1.0.0)
|
20
|
+
http_parser.rb (>= 0.5.1, < 0.7.0)
|
21
|
+
msgpack (>= 0.7.0, < 2.0.0)
|
22
|
+
serverengine (>= 2.0.4, < 3.0.0)
|
23
|
+
sigdump (~> 0.2.2)
|
24
|
+
strptime (>= 0.2.2, < 1.0.0)
|
25
|
+
tzinfo (~> 1.0)
|
26
|
+
tzinfo-data (~> 1.0)
|
27
|
+
yajl-ruby (~> 1.0)
|
28
|
+
hashdiff (0.3.7)
|
29
|
+
http_parser.rb (0.6.0)
|
30
|
+
msgpack (1.2.4)
|
31
|
+
power_assert (1.1.1)
|
32
|
+
public_suffix (3.0.2)
|
33
|
+
rake (0.9.6)
|
34
|
+
safe_yaml (1.0.4)
|
35
|
+
serverengine (2.0.6)
|
36
|
+
sigdump (~> 0.2.2)
|
37
|
+
sigdump (0.2.4)
|
38
|
+
strptime (0.2.3)
|
39
|
+
test-unit (3.2.7)
|
40
|
+
power_assert
|
41
|
+
thread_safe (0.3.6)
|
42
|
+
tzinfo (1.2.5)
|
43
|
+
thread_safe (~> 0.1)
|
44
|
+
tzinfo-data (1.2018.5)
|
45
|
+
tzinfo (>= 1.0.0)
|
46
|
+
webmock (3.4.1)
|
47
|
+
addressable (>= 2.3.6)
|
48
|
+
crack (>= 0.3.2)
|
49
|
+
hashdiff
|
50
|
+
yajl-ruby (1.4.0)
|
51
|
+
|
52
|
+
PLATFORMS
|
53
|
+
ruby
|
54
|
+
|
55
|
+
DEPENDENCIES
|
56
|
+
fluent-plugin-splunkhec!
|
57
|
+
rake (~> 0.9, >= 0.9.2)
|
58
|
+
test-unit (~> 3.1, >= 3.1.0)
|
59
|
+
webmock (>= 3.0)
|
60
|
+
|
61
|
+
BUNDLED WITH
|
62
|
+
1.16.1
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "fluent-plugin-splunkhec"
|
7
|
-
gem.version = "1.
|
7
|
+
gem.version = "1.7"
|
8
8
|
gem.authors = "Coen Meerbeek"
|
9
9
|
gem.email = "cmeerbeek@gmail.com"
|
10
10
|
gem.description = %q{Output plugin for the Splunk HTTP Event Collector.}
|
@@ -58,7 +58,7 @@ module Fluent
|
|
58
58
|
chunk.msgpack_each {|(tag,time,record)|
|
59
59
|
# Parse record to Splunk event format
|
60
60
|
case record
|
61
|
-
when
|
61
|
+
when Integer
|
62
62
|
event = record.to_s
|
63
63
|
when Hash
|
64
64
|
if @send_event_as_json
|
@@ -69,7 +69,7 @@ module Fluent
|
|
69
69
|
else
|
70
70
|
event = record
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
source = @source == 'tag' ? tag : @source
|
74
74
|
|
75
75
|
# Build body for the POST request
|
@@ -104,19 +104,16 @@ module Fluent
|
|
104
104
|
http = Net::HTTP.new(uri.host, uri.port)
|
105
105
|
|
106
106
|
# Create request
|
107
|
-
req = Net::HTTP::Post.new(uri, "Content-Type" => "application/json", "Authorization" => "Splunk #{@token}")
|
107
|
+
req = Net::HTTP::Post.new(uri, "Content-Type" => "application/json; charset=utf-8", "Authorization" => "Splunk #{@token}")
|
108
108
|
req.body = body
|
109
109
|
|
110
110
|
# Handle SSL
|
111
111
|
if @protocol == 'https'
|
112
112
|
http.use_ssl = true
|
113
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
114
113
|
end
|
115
114
|
|
116
115
|
# Send Request
|
117
|
-
res =
|
118
|
-
http.request(req)
|
119
|
-
end
|
116
|
+
res = http.request(req)
|
120
117
|
|
121
118
|
log.debug "splunkhec: HTTP Response Status Code is #{res.code}"
|
122
119
|
|
@@ -48,8 +48,8 @@ class SplunkHECOutputTest < Test::Unit::TestCase
|
|
48
48
|
assert_equal '8088', d.instance.port
|
49
49
|
assert_equal 'main', d.instance.index
|
50
50
|
assert_equal `hostname`.delete!("\n"), d.instance.event_host
|
51
|
-
assert_equal 'fluentd', d.instance.
|
52
|
-
assert_equal 'tag', d.instance.
|
51
|
+
assert_equal 'fluentd', d.instance.sourcetype
|
52
|
+
assert_equal 'tag', d.instance.source
|
53
53
|
assert_equal false, d.instance.send_event_as_json
|
54
54
|
assert_equal true, d.instance.usejson
|
55
55
|
assert_equal false, d.instance.send_batched_events
|
@@ -73,7 +73,7 @@ class SplunkHECOutputTest < Test::Unit::TestCase
|
|
73
73
|
.with(
|
74
74
|
headers: {
|
75
75
|
'Authorization' => "Splunk #{TOKEN}",
|
76
|
-
'Content-Type' => 'application/json; charset=utf-8'
|
76
|
+
'Content-Type' => 'application/json; charset=utf-8',
|
77
77
|
},
|
78
78
|
body: {
|
79
79
|
'time' => time,
|
@@ -95,7 +95,7 @@ class SplunkHECOutputTest < Test::Unit::TestCase
|
|
95
95
|
def test_should_use_tag_as_sourcetype_when_configured
|
96
96
|
splunk_request = stub_request(:post, SPLUNK_URL).with(body: hash_including({'sourcetype' => 'test'}))
|
97
97
|
|
98
|
-
d = create_driver_splunkhec(CONFIG + %[sourcetype
|
98
|
+
d = create_driver_splunkhec(CONFIG + %[sourcetype test])
|
99
99
|
d.run do
|
100
100
|
d.emit({'message' => 'data'}, 123456)
|
101
101
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-splunkhec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Coen Meerbeek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -104,8 +104,10 @@ executables: []
|
|
104
104
|
extensions: []
|
105
105
|
extra_rdoc_files: []
|
106
106
|
files:
|
107
|
+
- ".travis.yml"
|
107
108
|
- CHANGELOG.md
|
108
109
|
- Gemfile
|
110
|
+
- Gemfile.lock
|
109
111
|
- LICENSE
|
110
112
|
- README.md
|
111
113
|
- Rakefile
|