fluent-plugin-syslog_rfc5424 0.7.3.pre.rc.14 → 0.7.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 678c7679f9c40aed9163e9a96c81ab956cfb8ddb
|
4
|
+
data.tar.gz: 20ff60bbf06f1780dc17c49e54ec05cc9bdae4b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bce27bd480431a126c9f493802ff438a25866c259adfa8366168f567e66e301f7a01c64e1409e21923a4c0e7588c7bad911a76a2e9785aa5c0088735b25a154
|
7
|
+
data.tar.gz: 71080495b53c144288b384c20791889287e62d21686f7fd78c1b982d3ce629e07dbdc5749af0dfd48dc3d29365dbe0a928b157abff5cea25401f25ce3ce8c7e3
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.4.2
|
data/Rakefile
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require 'rake/testtask'
|
3
|
-
require 'fluent-plugin-syslog_rfc5424/version'
|
4
3
|
|
5
4
|
Rake::TestTask.new(:test) do |test|
|
6
5
|
test.libs << "lib" << "test"
|
@@ -9,7 +8,3 @@ Rake::TestTask.new(:test) do |test|
|
|
9
8
|
end
|
10
9
|
|
11
10
|
task default: :test
|
12
|
-
|
13
|
-
task :version do
|
14
|
-
puts FluentSyslog5424OutputPlugin::VERSION
|
15
|
-
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
2
|
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
|
4
|
+
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-syslog_rfc5424"
|
7
|
-
spec.version =
|
7
|
+
spec.version = "0.7.3"
|
8
8
|
spec.authors = ["Pivotal"]
|
9
9
|
spec.email = %w(cf-loggregator@pivotal.io)
|
10
10
|
spec.homepage = "https://github.com/cloudfoundry/fluent-plugin-syslog_rfc5424"
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
20
|
spec.add_development_dependency "bundler", "~> 2.0"
|
21
|
-
spec.add_development_dependency "rake", "~>
|
21
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
22
22
|
spec.add_development_dependency "test-unit", "~> 3.3"
|
23
23
|
spec.add_development_dependency "test-unit-rr", "~> 1.0"
|
24
24
|
spec.add_development_dependency "pry", "~> 0.12"
|
@@ -6,21 +6,13 @@ module Fluent
|
|
6
6
|
Fluent::Plugin.register_formatter('syslog_rfc5424', self)
|
7
7
|
|
8
8
|
config_param :rfc6587_message_size, :bool, default: true
|
9
|
-
config_param :hostname_field, :string, default: "hostname"
|
10
9
|
config_param :app_name_field, :string, default: "app_name"
|
11
10
|
config_param :proc_id_field, :string, default: "proc_id"
|
12
|
-
config_param :message_id_field, :string, default: "message_id"
|
13
|
-
config_param :structured_data_field, :string, default: "structured_data"
|
14
|
-
config_param :log_field, :string, default: "log"
|
15
11
|
|
16
12
|
def configure(conf)
|
17
13
|
super
|
18
|
-
@hostname_field_array = @hostname_field.split(".")
|
19
14
|
@app_name_field_array = @app_name_field.split(".")
|
20
15
|
@proc_id_field_array = @proc_id_field.split(".")
|
21
|
-
@message_id_field_array = @message_id_field.split(".")
|
22
|
-
@structured_data_field_array = @structured_data_field.split(".")
|
23
|
-
@log_field_array = @log_field.split(".")
|
24
16
|
end
|
25
17
|
|
26
18
|
def format(tag, time, record)
|
@@ -28,13 +20,10 @@ module Fluent
|
|
28
20
|
log.debug(record.map { |k, v| "#{k}=#{v}" }.join('&'))
|
29
21
|
|
30
22
|
msg = RFC5424::Formatter.format(
|
31
|
-
log: record
|
23
|
+
log: record['log'],
|
32
24
|
timestamp: time,
|
33
|
-
hostname: record.dig(*@hostname_field_array) || "-",
|
34
25
|
app_name: record.dig(*@app_name_field_array) || "-",
|
35
|
-
proc_id: record.dig(*@proc_id_field_array) || "-"
|
36
|
-
msg_id: record.dig(*@message_id_field_array) || "-",
|
37
|
-
sd: record.dig(*@structured_data_field_array) || "-"
|
26
|
+
proc_id: record.dig(*@proc_id_field_array) || "-"
|
38
27
|
)
|
39
28
|
|
40
29
|
log.debug("RFC 5424 Message")
|
@@ -46,4 +35,4 @@ module Fluent
|
|
46
35
|
end
|
47
36
|
end
|
48
37
|
end
|
49
|
-
end
|
38
|
+
end
|
@@ -65,54 +65,6 @@ class FormatterSyslogRFC5424Test < Test::Unit::TestCase
|
|
65
65
|
formatter_driver.instance.format(tag, time, record)
|
66
66
|
end
|
67
67
|
|
68
|
-
def test_format_with_log_field
|
69
|
-
formatter_driver = create_driver %(
|
70
|
-
@type syslog_rfc5424
|
71
|
-
rfc6587_message_size false
|
72
|
-
log_field example.custom_field
|
73
|
-
)
|
74
|
-
tag = "test-formatter"
|
75
|
-
time = Fluent::EventTime.new(0, 123456000)
|
76
|
-
record = {"log" => "test-log", "example" => {"custom_field" => "custom-value"}}
|
77
|
-
|
78
|
-
formatted_message = "<14>1 1970-01-01T00:00:00.123456+00:00 - - - - - custom-value\n"
|
79
|
-
message_size = formatted_message.length
|
80
|
-
assert_equal "#{formatted_message}",
|
81
|
-
formatter_driver.instance.format(tag, time, record)
|
82
|
-
end
|
83
|
-
|
84
|
-
def test_format_with_structured_data
|
85
|
-
formatter_driver = create_driver %(
|
86
|
-
@type syslog_rfc5424
|
87
|
-
rfc6587_message_size false
|
88
|
-
structured_data_field example.custom_field
|
89
|
-
)
|
90
|
-
tag = "test-formatter"
|
91
|
-
time = Fluent::EventTime.new(0, 123456000)
|
92
|
-
record = {"log" => "test-log", "example" => {"custom_field" => "custom-value"}}
|
93
|
-
|
94
|
-
formatted_message = "<14>1 1970-01-01T00:00:00.123456+00:00 - - - - custom-value test-log\n"
|
95
|
-
message_size = formatted_message.length
|
96
|
-
assert_equal "#{formatted_message}",
|
97
|
-
formatter_driver.instance.format(tag, time, record)
|
98
|
-
end
|
99
|
-
|
100
|
-
def test_format_with_hostname
|
101
|
-
formatter_driver = create_driver %(
|
102
|
-
@type syslog_rfc5424
|
103
|
-
rfc6587_message_size false
|
104
|
-
hostname_field example.custom_field
|
105
|
-
)
|
106
|
-
tag = "test-formatter"
|
107
|
-
time = Fluent::EventTime.new(0, 123456000)
|
108
|
-
record = {"log" => "test-log", "example" => {"custom_field" => "custom-value"}}
|
109
|
-
|
110
|
-
formatted_message = "<14>1 1970-01-01T00:00:00.123456+00:00 custom-value - - - - test-log\n"
|
111
|
-
message_size = formatted_message.length
|
112
|
-
assert_equal "#{formatted_message}",
|
113
|
-
formatter_driver.instance.format(tag, time, record)
|
114
|
-
end
|
115
|
-
|
116
68
|
def test_format_with_proc_id
|
117
69
|
formatter_driver = create_driver %(
|
118
70
|
@type syslog_rfc5424
|
@@ -129,20 +81,5 @@ class FormatterSyslogRFC5424Test < Test::Unit::TestCase
|
|
129
81
|
formatter_driver.instance.format(tag, time, record)
|
130
82
|
end
|
131
83
|
|
132
|
-
def test_format_with_message_id
|
133
|
-
formatter_driver = create_driver %(
|
134
|
-
@type syslog_rfc5424
|
135
|
-
rfc6587_message_size false
|
136
|
-
message_id_field example.custom_field
|
137
|
-
)
|
138
|
-
tag = "test-formatter"
|
139
|
-
time = Fluent::EventTime.new(0, 123456000)
|
140
|
-
record = {"log" => "test-log", "example" => {"custom_field" => "custom-value"}}
|
141
|
-
|
142
|
-
formatted_message = "<14>1 1970-01-01T00:00:00.123456+00:00 - - - custom-value - test-log\n"
|
143
|
-
message_size = formatted_message.length
|
144
|
-
assert_equal "#{formatted_message}",
|
145
|
-
formatter_driver.instance.format(tag, time, record)
|
146
|
-
end
|
147
84
|
|
148
|
-
end
|
85
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-syslog_rfc5424
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.3
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pivotal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04
|
11
|
+
date: 2020-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: test-unit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,7 +123,6 @@ files:
|
|
123
123
|
- README.md
|
124
124
|
- Rakefile
|
125
125
|
- fluent-plugin-syslog_rfc5424.gemspec
|
126
|
-
- lib/fluent-plugin-syslog_rfc5424/version.rb
|
127
126
|
- lib/fluent/plugin/formatter_syslog_rfc5424.rb
|
128
127
|
- lib/fluent/plugin/out_syslog_rfc5424.rb
|
129
128
|
- lib/rfc5424/formatter.rb
|
@@ -146,11 +145,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
145
|
version: '0'
|
147
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
147
|
requirements:
|
149
|
-
- - "
|
148
|
+
- - ">="
|
150
149
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
150
|
+
version: '0'
|
152
151
|
requirements: []
|
153
|
-
|
152
|
+
rubyforge_project:
|
153
|
+
rubygems_version: 2.6.13
|
154
154
|
signing_key:
|
155
155
|
specification_version: 4
|
156
156
|
summary: FluentD output plugin to send messages via rfc5424
|