Skip to content

Syslog

This chapter provides examples on how to use Netconf to manage Syslog configurations on AsterNOS devices.

hint{type=“warning”} NOTE: When configuring a syslog server with VRF, ensure the VRF exists first; otherwise, connection errors may occur since the network update may delays syslog connectivity.

Request example to create remote syslog server via edit-config.

<config>
<top>
<syslog>
<remote-server>
<ip>192.168.1.1</ip>
<port>514</port>
<vrf>default</vrf>
</remote-server>
</syslog>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:33955930-8051-4a86-903b-e3a335fc0d22">
<ok/>
</rpc-reply>

NOTE: When configuring a syslog server with VRF, ensure the VRF exists first; otherwise, connection errors may occur since the network update may delays syslog connectivity.

Request example to modify remote syslog server or source interface via edit-config.

<config>
<top>
<syslog>
<remote-server>
<ip>192.168.1.1</ip>
</remote-server>
<source-interface>eth0</source-interface>
</syslog>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:33955930-8051-4a86-903b-e3a335fc0d22">
<ok/>
</rpc-reply>

Request example to delete syslog remote server via edit-config.

<config>
<top>
<syslog>
<remote-server operation="delete">
<ip>192.168.1.1</ip>
</remote-server>
</syslog>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:5e1e8349-d8e4-4d20-a8e5-89fa83712aee">
<ok/>
</rpc-reply>

Request example to delete syslog source interface via edit-config.

<config>
<top>
<syslog operation="merge">
<source-interface operation="delete"/>
</syslog>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:5e1e8349-d8e4-4d20-a8e5-89fa83712aee">
<ok/>
</rpc-reply>

Request example to delete syslog remote server and source interface via edit-config.

<config>
<top>
<syslog operation="delete"/>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:5e1e8349-d8e4-4d20-a8e5-89fa83712aee">
<ok/>
</rpc-reply>

Request example to retrieve Syslog configurations via get-config with subtree filter.

<filter type="subtree">
<top>
<syslog/>
</top>
</filter>

Response example

<data>
<top>
<syslog xmlns="http://asterfusion.com/ns/yang/asternos-syslog">
<source-interface>eth0</source-interface>
<remote-server>
<ip>192.168.1.1</ip>
<port>514</port>
<vrf>default</vrf>
</remote-server>
</syslog>
</top>
</data>