fluent-plugin-splunkhec 2.0 → 2.3
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 +5 -5
- data/.github/workflows/ruby.yml +35 -0
- data/.gitignore +87 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +1 -1
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/fluent-plugin-splunkhec.gemspec +6 -6
- data/lib/fluent/plugin/out_splunkhec.rb +6 -6
- metadata +17 -22
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: e5e45e4cade0cf42639a07c021930e01ead711a2159e81300f5ebc52b2dfbbb3
|
|
4
|
+
data.tar.gz: 1475b7662149dc73fdba635b49e6bf176ffcbb80ab0bf63b06d4b4d7e241267c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ba491c998cb7ef304d478b3e15867c484f76dce5ec7def75e65914b1181acd65a159a0b3f18dea90c2f9c8ef925dfd40798310591264125cd048d4a6f4583606
|
|
7
|
+
data.tar.gz: 4636433b7d37a0c71375ea68612b8cfe2c85f95096ad9567208847e45376d61ffd5e4675b4a7d33ead99786079071b1d7b551ed330fa680ad24f10dde06fc99e
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
2
|
+
# They are provided by a third-party and are governed by
|
|
3
|
+
# separate terms of service, privacy policy, and support
|
|
4
|
+
# documentation.
|
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
|
7
|
+
|
|
8
|
+
name: Ruby
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
branches: [ master ]
|
|
13
|
+
pull_request:
|
|
14
|
+
branches: [ master ]
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
strategy:
|
|
21
|
+
matrix:
|
|
22
|
+
ruby-version: ['2.6', '2.7', '3.0']
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v2
|
|
26
|
+
- name: Set up Ruby
|
|
27
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
|
28
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
|
29
|
+
# uses: ruby/setup-ruby@v1
|
|
30
|
+
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
|
31
|
+
with:
|
|
32
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
33
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
|
34
|
+
- name: Run tests
|
|
35
|
+
run: bundle exec rake
|
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
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 2.3
|
|
2
|
+
|
|
3
|
+
Updated dependencies to solve security issues
|
|
4
|
+
|
|
5
|
+
## 2.2
|
|
6
|
+
|
|
7
|
+
Replaced deprecated packet statement
|
|
8
|
+
|
|
9
|
+
## 2.1
|
|
10
|
+
|
|
11
|
+
Replaced yajl/json_ge for regular yajl
|
|
12
|
+
|
|
1
13
|
## 2.0
|
|
2
14
|
|
|
3
15
|
Migrate to use FluentD v1 API. It doesn't support backwards compatibility.
|
data/Gemfile
CHANGED
data/LICENSE
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.3"
|
|
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.3
|
|
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.15.1", "< 2"]
|
|
20
|
+
gem.add_dependency "yajl-ruby", '>= 1.4.3'
|
|
21
|
+
gem.add_development_dependency "rake", '>= 13.0.6'
|
|
22
|
+
gem.add_development_dependency "test-unit", '~> 3.5', '>= 3.5.3'
|
|
23
|
+
gem.add_development_dependency "webmock", '>= 3.14.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
|
|
@@ -45,7 +45,7 @@ module Fluent::Plugin
|
|
|
45
45
|
@event_host = 'unknown'
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
|
-
@packer = Fluent::
|
|
48
|
+
@packer = Fluent::MessagePackFactory.engine_factory.packer
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
def start
|
|
@@ -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.3'
|
|
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: 2022-07-28 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.15.1
|
|
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.15.1
|
|
30
30
|
- - "<"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
32
|
version: '2'
|
|
@@ -36,74 +36,70 @@ dependencies:
|
|
|
36
36
|
requirements:
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 1.3
|
|
39
|
+
version: 1.4.3
|
|
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.3
|
|
46
|
+
version: 1.4.3
|
|
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.6
|
|
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.6
|
|
67
61
|
- !ruby/object:Gem::Dependency
|
|
68
62
|
name: test-unit
|
|
69
63
|
requirement: !ruby/object:Gem::Requirement
|
|
70
64
|
requirements:
|
|
71
65
|
- - "~>"
|
|
72
66
|
- !ruby/object:Gem::Version
|
|
73
|
-
version: '3.
|
|
67
|
+
version: '3.5'
|
|
74
68
|
- - ">="
|
|
75
69
|
- !ruby/object:Gem::Version
|
|
76
|
-
version: 3.
|
|
70
|
+
version: 3.5.3
|
|
77
71
|
type: :development
|
|
78
72
|
prerelease: false
|
|
79
73
|
version_requirements: !ruby/object:Gem::Requirement
|
|
80
74
|
requirements:
|
|
81
75
|
- - "~>"
|
|
82
76
|
- !ruby/object:Gem::Version
|
|
83
|
-
version: '3.
|
|
77
|
+
version: '3.5'
|
|
84
78
|
- - ">="
|
|
85
79
|
- !ruby/object:Gem::Version
|
|
86
|
-
version: 3.
|
|
80
|
+
version: 3.5.3
|
|
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.14.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.14.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
|
+
- ".github/workflows/ruby.yml"
|
|
102
|
+
- ".gitignore"
|
|
107
103
|
- ".travis.yml"
|
|
108
104
|
- CHANGELOG.md
|
|
109
105
|
- Gemfile
|
|
@@ -133,8 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
133
129
|
- !ruby/object:Gem::Version
|
|
134
130
|
version: '0'
|
|
135
131
|
requirements: []
|
|
136
|
-
|
|
137
|
-
rubygems_version: 2.5.2.3
|
|
132
|
+
rubygems_version: 3.0.3.1
|
|
138
133
|
signing_key:
|
|
139
134
|
specification_version: 4
|
|
140
135
|
summary: This plugin allows you to sent events to the Splunk HTTP Event Collector.
|