Skip to content

Commit f4cf1c1

Browse files
committed
Add support for syslog server hostname
schlagert/syslog version 3.4.3 adds support for specifying a host name for `dest_host`, this PR supports it as well See this gist for my test procedure: [email protected]:7ab6348839c3dc7b18b6662f024e089c.git
1 parent 08c6675 commit f4cf1c1

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ BUILD_DEPS = rabbitmq_cli
136136
DEPS = ranch syslog lager rabbit_common
137137
TEST_DEPS = rabbitmq_ct_helpers rabbitmq_ct_client_helpers amqp_client meck proper
138138

139-
dep_syslog = git https://github.com/schlagert/syslog 3.4.2
139+
dep_syslog = git https://github.com/schlagert/syslog 3.4.3
140140

141141
define usage_xml_to_erl
142142
$(subst __,_,$(patsubst $(DOCS_DIR)/rabbitmq%.1.xml, src/rabbit_%_usage.erl, $(subst -,_,$(1))))

priv/schema/rabbit.schema

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,9 +1086,8 @@ end}.
10861086
{datatype, {enum, [true, false]}}
10871087
]}.
10881088

1089-
{mapping, "log.syslog.ip", "syslog.dest_host", [
1090-
{datatype, string},
1091-
{validators, ["is_ip"]}
1089+
{mapping, "log.syslog.host", "syslog.dest_host", [
1090+
{datatype, string}
10921091
]}.
10931092

10941093
{mapping, "log.syslog.port", "syslog.dest_port", [
@@ -1353,12 +1352,6 @@ fun(File) ->
13531352
element(1, ReadFile) == ok
13541353
end}.
13551354

1356-
{validator, "is_ip", "string is a valid IP address",
1357-
fun(IpStr) ->
1358-
Res = inet:parse_address(IpStr),
1359-
element(1, Res) == ok
1360-
end}.
1361-
13621355
{validator, "non_negative_integer", "number should be greater or equal to zero",
13631356
fun(Int) when is_integer(Int) ->
13641357
Int >= 0

test/config_schema_SUITE_data/rabbit.snippets

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ credential_validator.regexp = ^abc\\d+",
540540
log.syslog.identity = rabbitmq
541541
log.syslog.facility = user
542542
log.syslog.multiline_mode = true
543-
log.syslog.ip = 10.10.10.10
543+
log.syslog.host = 10.10.10.10
544544
log.syslog.port = 123",
545545
[
546546
{rabbit,[{log, [{syslog, [{enabled, true}]}]}]},
@@ -554,10 +554,12 @@ credential_validator.regexp = ^abc\\d+",
554554
{log_syslog_tcp,
555555
"log.syslog = true
556556
log.syslog.transport = tcp
557-
log.syslog.protocol = rfc5424",
557+
log.syslog.protocol = rfc5424
558+
log.syslog.host = syslog.my-network.com",
558559
[
559560
{rabbit,[{log, [{syslog, [{enabled, true}]}]}]},
560-
{syslog, [{protocol, {rfc5424, tcp}}]}
561+
{syslog, [{protocol, {rfc5424, tcp}},
562+
{dest_host, "syslog.my-network.com"}]}
561563
],
562564
[]},
563565
{log_syslog_udp_default,

0 commit comments

Comments
 (0)