fluent-plugin-syslog_rfc5424 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f3e58806594ab10187d2c6909a9ec386b7644dc
|
4
|
+
data.tar.gz: 126da79f294d6843ce53f4b87a8ae2c7caf98a64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a565e5a16f4b8d9dc4536c116ca37b8059a620c5fa8efa3e2ef2c314ba89ba862e76bf89953cb9e122f951638622559db49146e8421742c6f96412d8de05aee3
|
7
|
+
data.tar.gz: 17917ed6c9720e60e2cbdd4e4776dcb5736f2feddfe77dcefa021f8c8803b034da2078ec7fc40b8eaa29cddfdfc07a8e0570d0b92370fe383c8b5b9d4608572f
|
@@ -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.6.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"
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
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"
|
25
|
-
spec.add_development_dependency "minitest"
|
25
|
+
spec.add_development_dependency "minitest", "~> 5.8"
|
26
26
|
|
27
27
|
spec.add_runtime_dependency "fluentd", "~> 1.7"
|
28
28
|
end
|
@@ -17,8 +17,8 @@ module Fluent
|
|
17
17
|
msg = RFC5424::Formatter.format(
|
18
18
|
log: record['log'],
|
19
19
|
timestamp: time,
|
20
|
-
app_name:
|
21
|
-
proc_id:
|
20
|
+
app_name: record.dig("kubernetes", "labels", "cloudfoundry.org/app_guid") || "-",
|
21
|
+
proc_id: record.dig("kubernetes", "pod_id") || "-"
|
22
22
|
)
|
23
23
|
|
24
24
|
log.debug("RFC 5424 Message")
|
@@ -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 -
|
20
|
+
assert_equal "<14>1 1970-01-01T00:00:00.123456+00:00 - - - - - 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 -
|
32
|
+
assert_equal "<14>1 1970-01-01T00:00:00.123456+00:00 - - - - - test-log",
|
33
33
|
formatter_driver.instance.format(tag, time, record)
|
34
34
|
end
|
35
35
|
|
@@ -42,9 +42,39 @@ 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 -
|
45
|
+
formatted_message = "<14>1 1970-01-01T00:00:00.123456+00:00 - - - - - 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)
|
49
49
|
end
|
50
|
+
|
51
|
+
def test_format_with_app_name
|
52
|
+
formatter_driver = create_driver %(
|
53
|
+
@type syslog_rfc5424
|
54
|
+
)
|
55
|
+
tag = "test-formatter"
|
56
|
+
time = Fluent::EventTime.new(0, 123456000)
|
57
|
+
record = {"log" => "test-log", "kubernetes" => {"labels" => { "cloudfoundry.org/app_guid" => "custom-value"}}}
|
58
|
+
|
59
|
+
formatted_message = "<14>1 1970-01-01T00:00:00.123456+00:00 - custom-value - - - test-log"
|
60
|
+
message_size = formatted_message.length
|
61
|
+
assert_equal "#{formatted_message}",
|
62
|
+
formatter_driver.instance.format(tag, time, record)
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_format_with_proc_id
|
66
|
+
formatter_driver = create_driver %(
|
67
|
+
@type syslog_rfc5424
|
68
|
+
)
|
69
|
+
tag = "test-formatter"
|
70
|
+
time = Fluent::EventTime.new(0, 123456000)
|
71
|
+
record = {"log" => "test-log", "kubernetes" => {"pod_id" => "custom-value"}}
|
72
|
+
|
73
|
+
formatted_message = "<14>1 1970-01-01T00:00:00.123456+00:00 - - custom-value - - test-log"
|
74
|
+
message_size = formatted_message.length
|
75
|
+
assert_equal "#{formatted_message}",
|
76
|
+
formatter_driver.instance.format(tag, time, record)
|
77
|
+
end
|
78
|
+
|
79
|
+
|
50
80
|
end
|
@@ -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 = "51 <14>1 1970-01-01T00:00:00.000123+00:00 - - - - - 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.6.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-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: minitest
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '5.8'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '5.8'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: fluentd
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|