fluent-plugin-splunkhec 2.0 → 2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +87 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/README.md +1 -1
- data/fluent-plugin-splunkhec.gemspec +6 -6
- data/lib/fluent/plugin/out_splunkhec.rb +5 -5
- metadata +20 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6c192f6388858c16d48010928c348af9bbffa18a628cebe8c08ee21a4937887d
|
4
|
+
data.tar.gz: 30f2b073d02daeb40dc42481095801f910e8962548ebf0a544619f3322cffc38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6f3f18c487984e8dfd8dc8ce9336030a295884a67f113e3e7d889a46618426bf0d007abc6abe425b41d0bced5a1e05cc9642e49661643a5f59bccb96f518772
|
7
|
+
data.tar.gz: 5e0510ab80a618d85a6753bb11adb131ccc9d0bd8c703f657fb5b55c572ce418fce661daa78e732e632f72a2973087f5ec950aeb88e63af4760fbf3a654f4a05
|
data/.gitignore
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
|
2
|
+
# Created by https://www.gitignore.io/api/ruby,macos
|
3
|
+
# Edit at https://www.gitignore.io/?templates=ruby,macos
|
4
|
+
|
5
|
+
### macOS ###
|
6
|
+
# General
|
7
|
+
.DS_Store
|
8
|
+
.AppleDouble
|
9
|
+
.LSOverride
|
10
|
+
|
11
|
+
# Icon must end with two \r
|
12
|
+
Icon
|
13
|
+
|
14
|
+
# Thumbnails
|
15
|
+
._*
|
16
|
+
|
17
|
+
# Files that might appear in the root of a volume
|
18
|
+
.DocumentRevisions-V100
|
19
|
+
.fseventsd
|
20
|
+
.Spotlight-V100
|
21
|
+
.TemporaryItems
|
22
|
+
.Trashes
|
23
|
+
.VolumeIcon.icns
|
24
|
+
.com.apple.timemachine.donotpresent
|
25
|
+
|
26
|
+
# Directories potentially created on remote AFP share
|
27
|
+
.AppleDB
|
28
|
+
.AppleDesktop
|
29
|
+
Network Trash Folder
|
30
|
+
Temporary Items
|
31
|
+
.apdisk
|
32
|
+
|
33
|
+
### Ruby ###
|
34
|
+
*.gem
|
35
|
+
*.rbc
|
36
|
+
/.config
|
37
|
+
/coverage/
|
38
|
+
/InstalledFiles
|
39
|
+
/pkg/
|
40
|
+
/spec/reports/
|
41
|
+
/spec/examples.txt
|
42
|
+
/test/tmp/
|
43
|
+
/test/version_tmp/
|
44
|
+
/tmp/
|
45
|
+
|
46
|
+
# Used by dotenv library to load environment variables.
|
47
|
+
# .env
|
48
|
+
|
49
|
+
# Ignore Byebug command history file.
|
50
|
+
.byebug_history
|
51
|
+
|
52
|
+
## Specific to RubyMotion:
|
53
|
+
.dat*
|
54
|
+
.repl_history
|
55
|
+
build/
|
56
|
+
*.bridgesupport
|
57
|
+
build-iPhoneOS/
|
58
|
+
build-iPhoneSimulator/
|
59
|
+
|
60
|
+
## Specific to RubyMotion (use of CocoaPods):
|
61
|
+
#
|
62
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
63
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
64
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
65
|
+
# vendor/Pods/
|
66
|
+
|
67
|
+
## Documentation cache and generated files:
|
68
|
+
/.yardoc/
|
69
|
+
/_yardoc/
|
70
|
+
/doc/
|
71
|
+
/rdoc/
|
72
|
+
|
73
|
+
## Environment normalization:
|
74
|
+
/.bundle/
|
75
|
+
/vendor/bundle
|
76
|
+
/lib/bundler/man/
|
77
|
+
|
78
|
+
# for a library or gem, you might want to ignore these files since the code is
|
79
|
+
# intended to run in multiple environments; otherwise, check them in:
|
80
|
+
# Gemfile.lock
|
81
|
+
# .ruby-version
|
82
|
+
# .ruby-gemset
|
83
|
+
|
84
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
85
|
+
.rvmrc
|
86
|
+
|
87
|
+
# End of https://www.gitignore.io/api/ruby,macos
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -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 = "2.
|
7
|
+
gem.version = "2.1"
|
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.}
|
@@ -16,10 +16,10 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
17
17
|
gem.require_paths = ["lib"]
|
18
18
|
|
19
|
-
gem.add_dependency "fluentd", [">=
|
20
|
-
gem.add_dependency "yajl-ruby", '>= 1.
|
21
|
-
gem.add_development_dependency "rake", '
|
22
|
-
gem.add_development_dependency "test-unit", '~> 3.
|
23
|
-
gem.add_development_dependency "webmock", '>= 3.0'
|
19
|
+
gem.add_dependency "fluentd", [">= 1.9.0", "< 2"]
|
20
|
+
gem.add_dependency "yajl-ruby", '>= 1.4.0'
|
21
|
+
gem.add_development_dependency "rake", '>= 13.0.0'
|
22
|
+
gem.add_development_dependency "test-unit", '~> 3.4', '>= 3.4.0'
|
23
|
+
gem.add_development_dependency "webmock", '>= 3.8.0'
|
24
24
|
gem.license = 'MIT'
|
25
25
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'fluent/plugin/output'
|
2
2
|
require 'net/http'
|
3
|
-
require 'yajl
|
3
|
+
require 'yajl'
|
4
4
|
|
5
5
|
module Fluent::Plugin
|
6
6
|
class SplunkHECOutput < Output
|
@@ -123,9 +123,9 @@ module Fluent::Plugin
|
|
123
123
|
event = record.to_s
|
124
124
|
when Hash
|
125
125
|
if @send_event_as_json
|
126
|
-
event = record
|
126
|
+
event = Yajl::Encoder.encode(record)
|
127
127
|
else
|
128
|
-
event = record.
|
128
|
+
event = Yajl::Encoder.encode(record).gsub("\"", %q(\\\"))
|
129
129
|
end
|
130
130
|
else
|
131
131
|
event = record
|
@@ -135,7 +135,7 @@ module Fluent::Plugin
|
|
135
135
|
|
136
136
|
# Build body for the POST request
|
137
137
|
if !@usejson
|
138
|
-
event = record["time"]+ " " + record["message"].
|
138
|
+
event = record["time"]+ " " + Yajl::Encoder.encode(record["message"]).gsub(/^"|"$/,"")
|
139
139
|
body << '{"time":"'+ DateTime.parse(record["time"]).strftime("%Q") +'", "event":"' + event + '", "sourcetype" :"' + sourcetype + '", "source" :"' + @source + '", "index" :"' + index + '", "host" : "' + event_host + '"}'
|
140
140
|
elsif @send_event_as_json
|
141
141
|
body << '{"time" :' + time.to_s + ', "event" :' + event + ', "sourcetype" :"' + sourcetype + '", "source" :"' + source + '", "index" :"' + index + '", "host" : "' + event_host + '"}'
|
@@ -180,7 +180,7 @@ module Fluent::Plugin
|
|
180
180
|
log.debug "splunkhec: HTTP Response Status Code is #{res.code}"
|
181
181
|
|
182
182
|
if res.code.to_i != 200
|
183
|
-
body =
|
183
|
+
body = Yajl::Parser.parse(res.body)
|
184
184
|
raise SplunkHECOutputError.new(body['text'], body['code'], body['invalid-event-number'], res.code)
|
185
185
|
end
|
186
186
|
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: '2.
|
4
|
+
version: '2.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Coen Meerbeek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.9.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '2'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 1.9.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2'
|
@@ -36,74 +36,69 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 1.
|
39
|
+
version: 1.4.0
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 1.
|
46
|
+
version: 1.4.0
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0.9'
|
54
51
|
- - ">="
|
55
52
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.
|
53
|
+
version: 13.0.0
|
57
54
|
type: :development
|
58
55
|
prerelease: false
|
59
56
|
version_requirements: !ruby/object:Gem::Requirement
|
60
57
|
requirements:
|
61
|
-
- - "~>"
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '0.9'
|
64
58
|
- - ">="
|
65
59
|
- !ruby/object:Gem::Version
|
66
|
-
version: 0.
|
60
|
+
version: 13.0.0
|
67
61
|
- !ruby/object:Gem::Dependency
|
68
62
|
name: test-unit
|
69
63
|
requirement: !ruby/object:Gem::Requirement
|
70
64
|
requirements:
|
71
|
-
- - "~>"
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version: '3.1'
|
74
65
|
- - ">="
|
75
66
|
- !ruby/object:Gem::Version
|
76
|
-
version: 3.
|
67
|
+
version: 3.4.0
|
68
|
+
- - "~>"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '3.4'
|
77
71
|
type: :development
|
78
72
|
prerelease: false
|
79
73
|
version_requirements: !ruby/object:Gem::Requirement
|
80
74
|
requirements:
|
81
|
-
- - "~>"
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: '3.1'
|
84
75
|
- - ">="
|
85
76
|
- !ruby/object:Gem::Version
|
86
|
-
version: 3.
|
77
|
+
version: 3.4.0
|
78
|
+
- - "~>"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '3.4'
|
87
81
|
- !ruby/object:Gem::Dependency
|
88
82
|
name: webmock
|
89
83
|
requirement: !ruby/object:Gem::Requirement
|
90
84
|
requirements:
|
91
85
|
- - ">="
|
92
86
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
87
|
+
version: 3.8.0
|
94
88
|
type: :development
|
95
89
|
prerelease: false
|
96
90
|
version_requirements: !ruby/object:Gem::Requirement
|
97
91
|
requirements:
|
98
92
|
- - ">="
|
99
93
|
- !ruby/object:Gem::Version
|
100
|
-
version:
|
94
|
+
version: 3.8.0
|
101
95
|
description: Output plugin for the Splunk HTTP Event Collector.
|
102
96
|
email: cmeerbeek@gmail.com
|
103
97
|
executables: []
|
104
98
|
extensions: []
|
105
99
|
extra_rdoc_files: []
|
106
100
|
files:
|
101
|
+
- ".gitignore"
|
107
102
|
- ".travis.yml"
|
108
103
|
- CHANGELOG.md
|
109
104
|
- Gemfile
|
@@ -133,8 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
128
|
- !ruby/object:Gem::Version
|
134
129
|
version: '0'
|
135
130
|
requirements: []
|
136
|
-
|
137
|
-
rubygems_version: 2.5.2.3
|
131
|
+
rubygems_version: 3.0.3
|
138
132
|
signing_key:
|
139
133
|
specification_version: 4
|
140
134
|
summary: This plugin allows you to sent events to the Splunk HTTP Event Collector.
|