fluent-plugin-syslog-d 0.0.1 → 0.0.2
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 +4 -4
- data/Gemfile.lock +17 -16
- data/lib/syslog_tls/version.rb +1 -1
- data/test/fluent/test_out_syslog_tls.rb +5 -5
- data/test/syslog_tls/test_logger.rb +2 -2
- data/test/syslog_tls/test_protocol.rb +10 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7de09d4cab52cec9d2d139f3533775145fb61c5277325835cc4b37a0da8dd91c
|
4
|
+
data.tar.gz: 31dfcd0086f8ba6141063104685b1034692c8ebd55acf17db4adb99b9ba46f45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54723ad8a57fd7074621db1d2b481a0017ac1c342ec7f03242b551944e8fca32fea04d838d221c1f533044ccb9ede5541c22c240adcae643acc57820f56381b9
|
7
|
+
data.tar.gz: 0f5f34eed97561fd519bbc66fcf8187cc7916c76ee5a8656af811f6698fc5322653bda7832edadb00db458aee3d105e1cfb194fbe2461d7f5fa7c9348610e826
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fluent-plugin-syslog-
|
4
|
+
fluent-plugin-syslog-d (0.0.2)
|
5
5
|
fluentd (>= 0.14.0, < 2)
|
6
6
|
|
7
7
|
GEM
|
@@ -9,7 +9,8 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
addressable (2.6.0)
|
11
11
|
public_suffix (>= 2.0.2, < 4.0)
|
12
|
-
|
12
|
+
concurrent-ruby (1.1.9)
|
13
|
+
cool.io (1.7.1)
|
13
14
|
coveralls (0.8.23)
|
14
15
|
json (>= 1.8, < 3)
|
15
16
|
simplecov (~> 0.16.1)
|
@@ -18,30 +19,30 @@ GEM
|
|
18
19
|
tins (~> 1.6)
|
19
20
|
crack (0.4.3)
|
20
21
|
safe_yaml (~> 1.0.0)
|
21
|
-
dig_rb (1.0.1)
|
22
22
|
docile (1.3.1)
|
23
|
-
fluentd (1.
|
23
|
+
fluentd (1.13.0)
|
24
|
+
bundler
|
24
25
|
cool.io (>= 1.4.5, < 2.0.0)
|
25
|
-
dig_rb (~> 1.0.0)
|
26
26
|
http_parser.rb (>= 0.5.1, < 0.7.0)
|
27
|
-
msgpack (>=
|
28
|
-
serverengine (>= 2.
|
27
|
+
msgpack (>= 1.3.1, < 2.0.0)
|
28
|
+
serverengine (>= 2.2.2, < 3.0.0)
|
29
29
|
sigdump (~> 0.2.2)
|
30
30
|
strptime (>= 0.2.2, < 1.0.0)
|
31
|
-
tzinfo (
|
31
|
+
tzinfo (>= 1.0, < 3.0)
|
32
32
|
tzinfo-data (~> 1.0)
|
33
|
+
webrick (>= 1.4.2, < 1.8.0)
|
33
34
|
yajl-ruby (~> 1.0)
|
34
35
|
hashdiff (0.4.0)
|
35
36
|
http_parser.rb (0.6.0)
|
36
37
|
json (2.2.0)
|
37
38
|
minitest (5.11.3)
|
38
39
|
minitest-stub_any_instance (1.0.2)
|
39
|
-
msgpack (1.2
|
40
|
+
msgpack (1.4.2)
|
40
41
|
power_assert (1.1.4)
|
41
42
|
public_suffix (3.1.0)
|
42
43
|
rake (12.3.2)
|
43
44
|
safe_yaml (1.0.5)
|
44
|
-
serverengine (2.
|
45
|
+
serverengine (2.2.4)
|
45
46
|
sigdump (~> 0.2.2)
|
46
47
|
sigdump (0.2.4)
|
47
48
|
simplecov (0.16.1)
|
@@ -49,22 +50,22 @@ GEM
|
|
49
50
|
json (>= 1.8, < 3)
|
50
51
|
simplecov-html (~> 0.10.0)
|
51
52
|
simplecov-html (0.10.2)
|
52
|
-
strptime (0.2.
|
53
|
+
strptime (0.2.5)
|
53
54
|
term-ansicolor (1.7.1)
|
54
55
|
tins (~> 1.0)
|
55
56
|
test-unit (3.3.3)
|
56
57
|
power_assert
|
57
58
|
thor (0.20.3)
|
58
|
-
thread_safe (0.3.6)
|
59
59
|
tins (1.20.3)
|
60
|
-
tzinfo (
|
61
|
-
|
62
|
-
tzinfo-data (1.
|
60
|
+
tzinfo (2.0.4)
|
61
|
+
concurrent-ruby (~> 1.0)
|
62
|
+
tzinfo-data (1.2021.1)
|
63
63
|
tzinfo (>= 1.0.0)
|
64
64
|
webmock (3.5.1)
|
65
65
|
addressable (>= 2.3.6)
|
66
66
|
crack (>= 0.3.2)
|
67
67
|
hashdiff
|
68
|
+
webrick (1.7.0)
|
68
69
|
yajl-ruby (1.4.1)
|
69
70
|
|
70
71
|
PLATFORMS
|
@@ -72,7 +73,7 @@ PLATFORMS
|
|
72
73
|
|
73
74
|
DEPENDENCIES
|
74
75
|
coveralls
|
75
|
-
fluent-plugin-syslog-
|
76
|
+
fluent-plugin-syslog-d!
|
76
77
|
minitest (~> 5.8)
|
77
78
|
minitest-stub_any_instance (~> 1.0.0)
|
78
79
|
rake
|
data/lib/syslog_tls/version.rb
CHANGED
@@ -85,7 +85,7 @@ class SyslogTlsOutputTest < Test::Unit::TestCase
|
|
85
85
|
instance.process('test', {time.to_i => record})
|
86
86
|
end
|
87
87
|
|
88
|
-
assert_equal "<134
|
88
|
+
assert_equal "<134>#{time.to_datetime.strftime("%b %d %H:%M:%S")} #{record.to_json.to_s}\n\n", logger.transport.string
|
89
89
|
end
|
90
90
|
|
91
91
|
def test_message_headers_mapping
|
@@ -110,7 +110,7 @@ class SyslogTlsOutputTest < Test::Unit::TestCase
|
|
110
110
|
instance.process('test', {time.to_i => record})
|
111
111
|
end
|
112
112
|
|
113
|
-
assert_true logger.transport.string.start_with?("<134
|
113
|
+
assert_true logger.transport.string.start_with?("<134>#{time.to_datetime.strftime("%b %d %H:%M:%S")} host app")
|
114
114
|
end
|
115
115
|
|
116
116
|
def test_message_severity_mapping
|
@@ -132,7 +132,7 @@ class SyslogTlsOutputTest < Test::Unit::TestCase
|
|
132
132
|
instance.process('test', {time.to_i => record})
|
133
133
|
end
|
134
134
|
|
135
|
-
assert_true logger.transport.string.start_with?("<128>
|
135
|
+
assert_true logger.transport.string.start_with?("<128>")
|
136
136
|
end
|
137
137
|
|
138
138
|
def test_formatter
|
@@ -156,7 +156,7 @@ class SyslogTlsOutputTest < Test::Unit::TestCase
|
|
156
156
|
end
|
157
157
|
|
158
158
|
formatted_time = time.dup.utc.strftime("%Y-%m-%dT%H:%M:%SZ")
|
159
|
-
assert_equal "<134
|
159
|
+
assert_equal "<134>#{time.to_datetime.strftime("%b %d %H:%M:%S")} #{formatted_time}\ttest\t#{record.to_json.to_s}\n\n", logger.transport.string
|
160
160
|
end
|
161
161
|
|
162
162
|
def test_ssl
|
@@ -166,7 +166,7 @@ class SyslogTlsOutputTest < Test::Unit::TestCase
|
|
166
166
|
server = ssl_server
|
167
167
|
st = Thread.new {
|
168
168
|
client = server.accept
|
169
|
-
assert_equal "<134
|
169
|
+
assert_equal "<134>#{time.to_datetime.strftime("%b %d %H:%M:%S")} host app #{record.to_json.to_s}\n", client.gets
|
170
170
|
client.close
|
171
171
|
}
|
172
172
|
|
@@ -23,7 +23,7 @@ class LoggerTest < Test::Unit::TestCase
|
|
23
23
|
l = SyslogTls::Logger.new(io, "TOKEN")
|
24
24
|
time = Time.now
|
25
25
|
l.log(:WARN, "MESSAGE", time: time)
|
26
|
-
assert_equal "<132
|
26
|
+
assert_equal "<132>#{time.to_datetime.strftime("%b %d %H:%M:%S")} MESSAGE\n", io.string
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_logger_default_headers
|
@@ -35,7 +35,7 @@ class LoggerTest < Test::Unit::TestCase
|
|
35
35
|
l.facility("SYSLOG")
|
36
36
|
time = Time.now
|
37
37
|
l.log(:WARN, "MESSAGE", time: time)
|
38
|
-
assert_equal "<44
|
38
|
+
assert_equal "<44>#{time.to_datetime.strftime("%b %d %H:%M:%S")} hostname appname MESSAGE\n", io.string
|
39
39
|
end
|
40
40
|
|
41
41
|
def test_logger_closed
|
@@ -30,7 +30,7 @@ class ProtocolTest < Test::Unit::TestCase
|
|
30
30
|
assert_equal SyslogTls::NIL_VALUE, h.procid
|
31
31
|
assert_equal SyslogTls::NIL_VALUE, h.msgid
|
32
32
|
|
33
|
-
assert_equal "<#{h.pri}
|
33
|
+
assert_equal "<#{h.pri}>#{h.timestamp.to_datetime.strftime("%b %d %H:%M:%S")} ", h.to_s
|
34
34
|
end
|
35
35
|
|
36
36
|
def test_header_facility_setter
|
@@ -70,25 +70,25 @@ class ProtocolTest < Test::Unit::TestCase
|
|
70
70
|
def test_header_hostname
|
71
71
|
h = SyslogTls::Header.new
|
72
72
|
h.hostname = "hostname"
|
73
|
-
assert_equal "<#{h.pri}
|
73
|
+
assert_equal "<#{h.pri}>#{h.timestamp.to_datetime.strftime("%b %d %H:%M:%S")} hostname ", h.to_s
|
74
74
|
end
|
75
75
|
|
76
76
|
def test_header_appname
|
77
77
|
h = SyslogTls::Header.new
|
78
78
|
h.app_name = "appname"
|
79
|
-
assert_equal "<#{h.pri}
|
79
|
+
assert_equal "<#{h.pri}>#{h.timestamp.to_datetime.strftime("%b %d %H:%M:%S")} appname", h.to_s
|
80
80
|
end
|
81
81
|
|
82
82
|
def test_header_procid
|
83
83
|
h = SyslogTls::Header.new
|
84
84
|
h.procid = $$
|
85
|
-
assert_equal "<#{h.pri}
|
85
|
+
assert_equal "<#{h.pri}>#{h.timestamp.to_datetime.strftime("%b %d %H:%M:%S")} ", h.to_s
|
86
86
|
end
|
87
87
|
|
88
88
|
def test_header_msgid
|
89
89
|
h = SyslogTls::Header.new
|
90
90
|
h.msgid = "msgid"
|
91
|
-
assert_equal "<#{h.pri}
|
91
|
+
assert_equal "<#{h.pri}>#{h.timestamp.to_datetime.strftime("%b %d %H:%M:%S")} ", h.to_s
|
92
92
|
end
|
93
93
|
|
94
94
|
def test_structured_data_defaults
|
@@ -118,26 +118,26 @@ class ProtocolTest < Test::Unit::TestCase
|
|
118
118
|
assert_equal 0, m.structured_data.length
|
119
119
|
assert_equal "", m.msg
|
120
120
|
|
121
|
-
assert_equal "<134
|
121
|
+
assert_equal "<134>#{m.header.timestamp.to_datetime.strftime("%b %d %H:%M:%S")} \n", m.to_s
|
122
122
|
end
|
123
123
|
|
124
124
|
def test_message_msg
|
125
125
|
m = SyslogTls::Message.new
|
126
126
|
m.msg = "TEST"
|
127
|
-
assert_equal "<134
|
127
|
+
assert_equal "<134>#{m.header.timestamp.to_datetime.strftime("%b %d %H:%M:%S")} TEST\n", m.to_s
|
128
128
|
end
|
129
129
|
|
130
130
|
def test_message_sd
|
131
131
|
m = SyslogTls::Message.new
|
132
132
|
m.structured_data << SyslogTls::StructuredData.new("TEST_ID")
|
133
|
-
assert_equal "<134
|
133
|
+
assert_equal "<134>#{m.header.timestamp.to_datetime.strftime("%b %d %H:%M:%S")} \n", m.to_s
|
134
134
|
end
|
135
135
|
|
136
136
|
def test_message_multiple_sd
|
137
137
|
m = SyslogTls::Message.new
|
138
138
|
m.structured_data << SyslogTls::StructuredData.new("TEST_ID")
|
139
139
|
m.structured_data << SyslogTls::StructuredData.new("TEST_ID2")
|
140
|
-
assert_equal "<134
|
140
|
+
assert_equal "<134>#{m.header.timestamp.to_datetime.strftime("%b %d %H:%M:%S")} \n", m.to_s
|
141
141
|
end
|
142
142
|
|
143
143
|
def test_message_multiple_sd_msg
|
@@ -145,6 +145,6 @@ class ProtocolTest < Test::Unit::TestCase
|
|
145
145
|
m.structured_data << SyslogTls::StructuredData.new("TEST_ID")
|
146
146
|
m.structured_data << SyslogTls::StructuredData.new("TEST_ID2")
|
147
147
|
m.msg = "MSG"
|
148
|
-
assert_equal "<134
|
148
|
+
assert_equal "<134>#{m.header.timestamp.to_datetime.strftime("%b %d %H:%M:%S")} MSG\n", m.to_s
|
149
149
|
end
|
150
150
|
end
|