Skip to content

Commit

Permalink
always use the systems hostname when streaming the syslog
Browse files Browse the repository at this point in the history
Signed-off-by: John Crispin <[email protected]>
  • Loading branch information
blogic committed Feb 3, 2022
1 parent b2dc0b7 commit f8f458a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion renderer/templates/services/log.uc
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{% if (!length(log)) return %}
{%
if (!length(log)) return;
let hostname = state.unit?.hostname;
if (!hostname) {
cursor.load("system");
let system = cursor.get_all("system", "@system[-1]");
hostname = system?.hostname || OpenWifi;
}
%}

# Syslog service configuration

Expand All @@ -7,3 +15,4 @@ set system.@system[-1].log_port={{ s(log.port) }}
set system.@system[-1].log_proto={{ s(log.proto) }}
set system.@system[-1].log_size={{ s(log.size) }}
set system.@system[-1].log_priority={{ s(log.priority) }}
set system.@system[-1].log_hostname={{ s(hostname) }}

0 comments on commit f8f458a

Please sign in to comment.