Closed troglobit closed 3 months ago
Current ietf-syslog.yang
(draft) model https://datatracker.ietf.org/doc/draft-ietf-netmod-syslog-model/
module: ietf-syslog
+--rw syslog!
+--rw actions
+--rw console! {console-action}?
| +--rw facility-filter
| | +--rw facility-list* [facility severity]
| | +--rw facility union
| | +--rw severity union
| | +--rw advanced-compare {select-adv-compare}?
| | +--rw compare? enumeration
| | +--rw action? identityref
| +--rw pattern-match? string {select-match}?
+--rw file {file-action}?
| +--rw log-file* [name]
| +--rw name inet:uri
| +--rw facility-filter
| | +--rw facility-list* [facility severity]
| | +--rw facility union
| | +--rw severity union
| | +--rw advanced-compare {select-adv-compare}?
| | +--rw compare? enumeration
| | +--rw action? identityref
| +--rw pattern-match? string {select-match}?
| +--rw structured-data? boolean {structured-data}?
| +--rw file-rotation
| +--rw number-of-files? uint32 {file-limit-size}?
| +--rw max-file-size? uint32 {file-limit-size}?
| +--rw rollover? uint32 {file-limit-duration}?
| +--rw retention? uint32 {file-limit-duration}?
+--rw remote {remote-action}?
+--rw destination* [name]
+--rw name string
+--rw (transport)
| +--:(udp)
| | +--rw udp
| | +--rw address? inet:host
| | +--rw port? inet:port-number
| +--:(tls)
| +--rw tls
| +--rw address? inet:host
| +--rw port? inet:port-number
+--rw facility-filter
| +--rw facility-list* [facility severity]
| +--rw facility union
| +--rw severity union
| +--rw advanced-compare {select-adv-compare}?
| +--rw compare? enumeration
| +--rw action? identityref
+--rw pattern-match? string {select-match}?
+--rw structured-data? boolean {structured-data}?
+--rw facility-override? identityref
+--rw source-interface? if:interface-ref {remote-source-interface}?
+--rw signing! {signed-messages}?
+--rw cert-signers
+--rw cert-signer* [name]
| +--rw name string
| +--rw cert
| +--rw hash-algorithm? enumeration
+--rw cert-initial-repeat? uint32
+--rw cert-resend-delay? uint32
+--rw cert-resend-count? uint32
+--rw sig-max-delay? uint32
+--rw sig-number-resends? uint32
+--rw sig-resend-delay? uint32
+--rw sig-resend-count? uint32
Split up work in three parts (feature levels):
{file-action}
{remote-action}
{console-action}
The console action may not even be necessary.
ping @jovatn -- maybe you could take a quick peek at this scope proposal?
What a nice surprise! :-)
Resulting complete model, with limited feature set, augments and deviations. Notice the global file rotation and server mode.
$ ./utils/lint.sh -f tree -F ietf-syslog:file-action,file-limit-size,remote-action \
ietf-inet-types@2013-07-15.yang \
ietf-syslog@2024-03-21.yang \
infix-syslog@2024-07-18.yang
module: ietf-inet-types
module: ietf-syslog
+--rw syslog!
+--rw actions
| +--rw file {file-action}?
| | +--rw log-file* [name]
| | +--rw name inet:uri
| | +--rw facility-filter
| | | +--rw facility-list* [facility severity]
| | | +--rw facility union
| | | +--rw severity union
| | +--rw file-rotation
| | | +--rw number-of-files? uint32 {file-limit-size}?
| | | +--rw max-file-size? uint32 {file-limit-size}?
| | +--rw infix-syslog:log-format? identityref
| +--rw remote {remote-action}?
| +--rw destination* [name]
| +--rw name string
| +--rw (transport)
| | +--:(udp)
| | +--rw udp
| | +--rw address? inet:host
| | +--rw port? inet:port-number
| +--rw facility-filter
| | +--rw facility-list* [facility severity]
| | +--rw facility union
| | +--rw severity union
| +--rw infix-syslog:log-format? identityref
+--rw infix-syslog:file-rotation
| +--rw infix-syslog:number-of-files? uint32
| +--rw infix-syslog:max-file-size? uint32
+--rw infix-syslog:server
+--rw infix-syslog:enabled? boolean
+--rw infix-syslog:listen
+--rw (infix-syslog:listen)?
+--:(infix-syslog:udp)
+--rw infix-syslog:udp* [port]
+--rw infix-syslog:port inet:port-number
+--rw infix-syslog:address? inet:ip-address
module: infix-syslog
augment /syslog:syslog:
+--rw file-rotation
| +--rw number-of-files? uint32
| +--rw max-file-size? uint32
+--rw server
+--rw enabled? boolean
+--rw listen
+--rw (listen)?
+--:(udp)
+--rw udp* [port]
+--rw address? inet:ip-address
+--rw port inet:port-number
augment /syslog:syslog/syslog:actions/syslog:file/syslog:log-file:
+---u log-format
augment /syslog:syslog/syslog:actions/syslog:remote/syslog:destination:
+---u log-format
Initial Requirements
authpriv.*
is never sent to remote serverScope
The following details the initial scope for the implementation. Using std.
{feature}
notation, with crossed outwe can skip in this initial support:{feature}
{file-action}
/log/<FILE>
factory-config
, classify instead as system log filesfile:/media/log/my.log
(see #538){file-limit-size}
(log rotation, with sane globally configurable defaults)Support(future){select-adv-compare}
/etc/syslog.d/log-file-NAME.conf
/etc/syslog.d/rotate.conf
{remote-action}
tls transport(not supported yet bysysklogd
)/etc/syslog.d/remote-NAME.conf
(not required){console-action}
(not supported yet by{signed-messages}
sysklogd
)/etc/syslog.d/server.conf
Deviations
sysklogd
)sysklogd
)Augments
Global Log Rotation
Defaults for log rotation, parallel to
/syslog/actions
, as/syslog/file-rotation
Log Sink
Acting as log sink, i.e., the remote log server.
secure_mode 0
(default 1)/syslog/server
, settings:enabled
port
, default 514Log Format
The standard model does not support log format, so it needs to be augmented to support:
{file-action}
RFC5424
(default:RFC3164
){remote-action}
RFC3164
(default:BSD
)RFC5424
Local Facilities
Facilities marked
*
are local augments to the model.Example