Syslog
This chapter provides examples on how to use Netconf to manage Syslog configurations on AsterNOS devices.
Modify Syslog Source Interface
Section titled “Modify Syslog Source Interface”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>Modify Remote Syslog Server
Section titled “Modify Remote Syslog Server”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>Delete Syslog Remote Server
Section titled “Delete Syslog Remote Server”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>Delete Syslog Source Interface
Section titled “Delete Syslog Source Interface”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>Delete All Syslog Configurations
Section titled “Delete All Syslog Configurations”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>Get All Syslog Configurations
Section titled “Get All Syslog Configurations”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>