fluent-plugin-syslog_rfc5424 0.3.1 → 0.4.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d18ce4a652bcc4290cc9dacb98e7b6d8c05d7d8d
|
4
|
+
data.tar.gz: 9f8bcbc47850d81ebaee276d454efb2efb889972
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8368f0f1c15eb5f06733f0741d1014e9f30f875fd9abad9891d9c8012095346c76727c1a0514ef759f0c8ac9c6a41895d67d16888e872ca15086c418ab08f338
|
7
|
+
data.tar.gz: a2fbeccef2c610298a71368e2fe646db1c2d54394fb666f1d0f57c452455618be6bd2013ae1e62039a705683f59ed4f74ddc67eb7db5c89a8240a08af297b0d7
|
@@ -4,7 +4,7 @@ $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 = "0.
|
7
|
+
spec.version = "0.4.0"
|
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"
|
@@ -3,15 +3,20 @@ require 'rfc5424/formatter'
|
|
3
3
|
module Fluent
|
4
4
|
module Plugin
|
5
5
|
class FormatterSyslogRFC5424 < Formatter
|
6
|
-
Fluent::Plugin.register_formatter(
|
6
|
+
Fluent::Plugin.register_formatter('syslog_rfc5424', self)
|
7
7
|
|
8
8
|
config_param :rfc6587_message_size, :bool, default: false
|
9
9
|
|
10
10
|
def format(tag, time, record)
|
11
|
-
msg = RFC5424::Formatter.format(
|
11
|
+
msg = RFC5424::Formatter.format(
|
12
|
+
log: record['log'],
|
13
|
+
timestamp: time,
|
14
|
+
app_name: 'app-name',
|
15
|
+
proc_id: 'instance-id'
|
16
|
+
)
|
12
17
|
return msg unless @rfc6587_message_size
|
13
18
|
|
14
|
-
msg.length.to_s +
|
19
|
+
msg.length.to_s + ' ' + msg
|
15
20
|
end
|
16
21
|
end
|
17
22
|
end
|
@@ -17,7 +17,7 @@ class FormatterSyslogRFC5424Test < Test::Unit::TestCase
|
|
17
17
|
tag = "test-formatter"
|
18
18
|
time = Fluent::EventTime.new(0, 123456000)
|
19
19
|
record = {"log" => "test-log"}
|
20
|
-
assert_equal "<14>1 1970-01-01T00:00:00.123456+00:00 - - - - - test-log",
|
20
|
+
assert_equal "<14>1 1970-01-01T00:00:00.123456+00:00 - app-name instance-id - - test-log",
|
21
21
|
formatter_driver.instance.format(tag, time, record)
|
22
22
|
end
|
23
23
|
|
@@ -29,7 +29,7 @@ class FormatterSyslogRFC5424Test < Test::Unit::TestCase
|
|
29
29
|
tag = "test-formatter"
|
30
30
|
time = Fluent::EventTime.new(0, 123456000)
|
31
31
|
record = {"log" => "test-log"}
|
32
|
-
assert_equal "<14>1 1970-01-01T00:00:00.123456+00:00 - - - - - test-log",
|
32
|
+
assert_equal "<14>1 1970-01-01T00:00:00.123456+00:00 - app-name instance-id - - test-log",
|
33
33
|
formatter_driver.instance.format(tag, time, record)
|
34
34
|
end
|
35
35
|
|
@@ -42,7 +42,7 @@ class FormatterSyslogRFC5424Test < Test::Unit::TestCase
|
|
42
42
|
time = Fluent::EventTime.new(0, 123456000)
|
43
43
|
record = {"log" => "test-log"}
|
44
44
|
|
45
|
-
formatted_message = "<14>1 1970-01-01T00:00:00.123456+00:00 - - - - - test-log"
|
45
|
+
formatted_message = "<14>1 1970-01-01T00:00:00.123456+00:00 - app-name instance-id - - test-log"
|
46
46
|
message_size = formatted_message.length
|
47
47
|
assert_equal "#{message_size} #{formatted_message}",
|
48
48
|
formatter_driver.instance.format(tag, time, record)
|
@@ -5,7 +5,7 @@ class OutSyslogRFC5424Test < Test::Unit::TestCase
|
|
5
5
|
def setup
|
6
6
|
Fluent::Test.setup
|
7
7
|
@time = Fluent::EventTime.new(0, 123456)
|
8
|
-
@formatted_log = "
|
8
|
+
@formatted_log = "68 <14>1 1970-01-01T00:00:00.000123+00:00 - app-name instance-id - - hi"
|
9
9
|
end
|
10
10
|
|
11
11
|
def create_driver(conf = CONFIG)
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pivotal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|