Syslog
AsterNOS-Syslog
This chapter provides examples on how to use Netconf to manage Syslog configurations on AsterNOS devices.
Modify Syslog Source Interface
NOTE: The source-interface value must be a valid interface name that can be used as the source for syslog server communication. It can be one of the following types:
- The physical port, named like "Ethernet0", etc
- The sub-vlan-interfaces, named like "Eth0.1", etc
- Loopback interfaces, named like "Loopback0", etc
- VLAN interfaces named with valid VLAN IDs ranging from 0 to 4094, such as "Vlan100", etc
- The mgmt interface "eth0"
Request example to modify syslog source interface via edit-config.
<config>
<top>
<syslog>
<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:2ae38810-e0b8-46fd-b32c-29db527e1bb2">
<ok/>
</rpc-reply>Create 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 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
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
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
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
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
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>