No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

NETCONF YANG API Reference

AR100, AR120, AR160, AR1200, AR2200, AR3200, and AR3600 V300R003

NETCONF YANG API Reference
Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Configuring the Function of Reporting Logs to Hosts

Configuring the Function of Reporting Logs to Hosts

Data Model

The data model file matching the function of reporting logs to hosts is huawei-syslog.yang.

Table 3-2212 Reporting logs to hosts

Object

Description

ietf-syslog/syslog/remote-logging-action

ietf-syslog/syslog/log-actions

Indicates that the operation request (creating, deleting, and modifying) object is configuration of reporting logs to hosts. It is only used to contain sub-objects, but does not have any data meaning.

ietf-syslog/syslog/remote/destination/name

Indicates the name of the configuration for reporting logs to hosts, which identifies different configurations.

NOTE:

Ensure that the name parameter is unique. It is only used to prompt and deliver configurations.

ietf-syslog/syslog/log-actions/remote/destination/tcp

Indicates the TCP information transport mode.

NOTE:
  • Before configuring the tcp parameter, you need to configure an SSL policy on the device. Otherwise, the information transfer mode for reporting logs to hosts cannot be set to TCP.
  • An SSL policy can be configured only through the CLI. For details, see Example for Configuring a Client SSL Policy.

ietf-syslog/syslog/log-actions/remote/destination/udp

Indicates the UDP information transport mode.

ietf-syslog/syslog/log-actions/remote/destination/transport/tcp/ssl-policy

Indicates the name of an SSL policy used in TCP information transfer mode. The value is a string of 1 to 31 case-sensitive characters without spaces or question marks (?).

NOTE:
  • The ssl-policy parameter is supported only in TCP mode.
  • Before configuring the ssl-policy parameter, you need to configure an SSL policy on the device.

ietf-syslog/syslog/log-actions/remote/destination/transport/tcp/address

Indicates the IPv4 address of the log host in TCP transfer mode. The value is in dotted decimal notation.

ietf-syslog/syslog/log-actions/remote/destination/transport/tcp/port

Indicates the port number of the log host in TCP transfer mode. The value is an integer that ranges from 1 to 65535.

ietf-syslog/syslog/log-actions/remote/destination/transport/udp/address

Indicates the IPv4 address of the log host in UDP transfer mode. The value is in dotted decimal notation.

ietf-syslog/syslog/log-actions/remote/destination/transport/udp/port

Indicates the port number of the log host in UDP transfer mode. The value is an integer that ranges from 1 to 65535.

ietf-syslog/syslog/syslog/log-actions/remote/sendswitch

Indicates whether the function of reporting logs to hosts is configured. The value is of the enumerated type and can be on or off.

ietf-syslog/syslog/log-actions/remote/destination/vpn-instance

Indicates the name of the VPN instance used for transmission. The value is a string of 1 to 31 case-sensitive characters without spaces. If the string is enclosed in double quotation marks (" "), the string can contain spaces.

NOTE:
  • Before configuring the vpn-instance parameter, you need to configure a VPN instance on the device.
  • The vpn-instance parameter is optional.

ietf-syslog/syslog/log-actions/remote/hostname

Indicates the type of the Syslog source host name. It can be specified using the system name or ESN of the device.

ietf-syslog/syslog/log-actions/timestamp/logformat

Indicates the timestamp format of the output log, trap, and debugging information. The value is of the enumerated type and can be log-format-boot, log-formate-date, log-formate-short-date, or log-formate-formate-date.

  • log-format-boot: indicates that the timestamp is the period of time elapsed since the system startup. The format is xxxxxx.yyyyyy. xxxxxx is the higher order 32 bits of the number of milliseconds elapsed since the system startup. yyyyyy is the lower order 32 bits of the number of milliseconds elapsed since the system startup.
  • log-formate-date: indicates that the timestamp is the current system date and time, in the format mm dd yyyy hh:mm:ss.
  • log-formate-short-date: indicates that the timestamp is the current system date and time excluding the year, in the format mm dd hh:mm:ss.
  • log-formate-formate-date: indicates that the timestamp is in the format YYYY-MM-DD hh:mm:ss.

    By default, the timestamp of log, trap, and debugging information is the current system data and time.

NOTE:

V300R003C10 and later versions support this object.

ietf-syslog/syslog/log-actions/timestamp/logtype

Indicates the output log type. The value is of the enumerated type and can be log-type-log, log-type-trap, or log-type-debugging.

  • log-type-debugging: indicates debugging information.
  • log-type-log: indicates log information.
  • log-type-trap: indicates trap information.
NOTE:

V300R003C10 and later versions support this object.

Configuring the Function of Reporting Logs to Hosts

This section provides a sample of configuring the function of reporting logs to hosts.

NOTE:
  • To transfer logs to the log hosts using TCP and encrypt logs using SSL, create an SSL policy first.
  • Before configuring the vpn-instance parameter, you need to create a VPN instance on the device.
Table 3-2213 Configuring the function of reporting logs to hosts

Operation

XPATH

edit-config:merge

ietf-syslog/syslog/log-actions/remote/destination/transport/tcp/ssl-policy

ietf-syslog/syslog/log-actions/remote/destination/vpn-instance

Data Requirements
Table 3-2214 Configuring the function of reporting logs to hosts

Item

Data

Description

Name of the configuration for reporting logs to hosts

destname1

Configure the name destname1 for the configurationof sending logs to hosts and configure the VPN instance test1 used for transmission. Set the information transfer mode to TCP, IPv4 address of the log host to 3.2.2.1, and port number of the log host to 2221. Configure the information to be encrypted using an SSL policy client-policy1.

Configure the name destname2 for the configuration of sending logs to hosts and configure the VPN instance test3 used for transmission. Set the information transfer mode to UDP, IPv4 address of the log host to 3.2.2.2, and port number of the log host to 1220.

Set the log source host name type to the sysname of the device and enable the function of reporting logs to hosts.

Name of the VPN instance used for transmission

test1

IPv4 address of the log host in TCP transfer mode

3.2.2.1

Port number of the log host in TCP transfer mode

2221

SSL policy name in the TCP transport mode

client-policy1

Name of the configuration for reporting logs to hosts

destname2

Name of the VPN instance used for transmission

test3

IPv4 address of the log host in UDP transfer mode

3.2.2.2

Port number of the log host in UDP transfer mode

1220

Log source host name type

esn

Reporting logs to hosts

on

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_08a6ff32d57a4684b7054a53b32042de">
 <edit-config>
  <target>
   <running/>
  </target>
  <error-option>rollback-on-error</error-option>
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
   <syslog xmlns="urn:ietf:params:xml:ns:yang:ietf-syslog" xc:operation="merge"> 
    <log-actions>
     <remote>
      <destination>
       <name>destname1</name>
       <vpn-instance xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog">test1</vpn-instance>
       <tcp>
        <address>3.2.2.1</address>
        <port>2221</port>
        <ssl-policy xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog">client-policy1</ssl-policy>
       </tcp>
       <log-selector>
        <no-facilities/>
       </log-selector>
      </destination>
      <destination>
       <name>destname2</name>
       <vpn-instance xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog">test3</vpn-instance>
       <udp>
        <address>3.2.2.2</address>
        <port>1220</port>
       </udp>
       <log-selector>
        <no-facilities/>
       </log-selector>
      </destination>
      <hostname xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog">esn</hostname>
      <sendswitch xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog">on</sendswitch>
     </remote>
    </log-actions>
   </syslog>
  </config> 
 </edit-config> 
</rpc>
Response Example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_08a6ff32d57a4684b7054a53b32042de">  
 <ok/>  
</rpc-reply>

Modifying the Function of Reporting Logs to Hosts

This section provides a sample of modifying the function of reporting logs to hosts.

NOTE:
  • To transfer logs to the log hosts using TCP and encrypt logs using SSL, create an SSL policy first.
  • Before configuring the vpn-instance parameter, you need to create a VPN instance on the device.
Table 3-2215 Modifying the function of reporting logs to hosts

Operation

XPATH

edit-config:replace

ietf-syslog/syslog/log-actions/remote/destination/transport/tcp/ssl-policy

ietf-syslog/syslog/log-actions/remote/destination/vpn-instance

Data Requirements
Table 3-2216 Modifying the function of reporting logs to hosts

Item

Data

Description

Name of the configuration for reporting logs to hosts

destname1

Change the name destname1 for the configuration of sending logs to hosts and change the VPN instance to test1 used for transmission. Change the information transfer mode to TCP, IPv4 address of the log host to 3.2.2.101, and port number of the log host to 2221. Configure the information to be encrypted using an SSL policy client-policy1.

Change the name destname2 for the configuration of sending logs to hosts and change the VPN instance to test3 used for transmission. Change the information transfer mode to UDP, IPv4 address of the log host to 3.2.2.2, and port number of the log host to 1227.

Name of the VPN instance used for transmission

test1

IPv4 address of the log host in TCP transfer mode

3.2.2.101

Port number of the log host in TCP transfer mode

2221

SSL policy name in the TCP transport mode

client-policy1

Name of the configuration for reporting logs to hosts

destname2

Name of the VPN instance used for transmission

test3

IPv4 address of the log host in UDP transfer mode

3.2.2.2

Port number of the log host in UDP transfer mode

1227

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_08a6ff32d57a4684b7054a53b32042de">
 <edit-config>
  <target>
   <running/>
  </target>
  <error-option>rollback-on-error</error-option>
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
   <syslog xmlns="urn:ietf:params:xml:ns:yang:ietf-syslog"> 
    <log-actions>
     <remote xc:operation="replace">
      <destination >
       <name>destname1</name>
       <vpn-instance xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog">test1</vpn-instance>
       <tcp>
        <address>3.2.2.101</address>
        <port>2221</port>
        <ssl-policy xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog">client-policy1</ssl-policy>
       </tcp>
       <log-selector>
        <no-facilities/>
       </log-selector>
      </destination>
      <destination>
       <name>destname2</name>
       <vpn-instance xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog">test3</vpn-instance>
       <udp>
        <address>3.2.2.2</address>
        <port>1227</port>
       </udp>
       <log-selector>
        <no-facilities/>
       </log-selector>
      </destination>
     </remote>
    </log-actions>
   </syslog>
  </config> 
 </edit-config> 
</rpc>
Response Example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_08a6ff32d57a4684b7054a53b32042de">  
 <ok/>  
</rpc-reply>

Deleting the Function of Reporting Logs to Hosts

This section provides a sample of deleting the function of reporting logs to hosts.

Table 3-2217 Deleting the function of reporting logs to hosts

Operation

XPATH

edit-config:remove

ietf-syslog/syslog/log-actions/remote/destination/transport/tcp/ssl-policy

ietf-syslog/syslog/log-actions/remote/destination/vpn-instance

Data Requirements
Table 3-2218 Deleting the function of reporting logs to hosts

Item

Data

Description

Name of the configuration for reporting logs to hosts

destname1

Delete the name destname1 for the configuration of sending logs to hosts and delete the VPN instance test1 used for transmission. Delete the TCP information transfer mode, IPv4 address 3.2.2.101 of the log host, and port number 2221 of the log host. Cancel encrypting the information using an SSL policy client-policy1.

Delete the name destname2 for the configuration of sending logs to hosts and delete the VPN instance test3 used for transmission. Delete the UDP information transfer mode, IPv4 address 3.2.2.2 of the log host, and port number 1227 of the log host.

Set the log source host name type to the sysname of the device and disable the function of reporting logs to hosts.

Name of the VPN instance used for transmission

test1

IPv4 address of the log host in TCP transfer mode

3.2.2.101

Port number of the log host in TCP transfer mode

2221

SSL policy name in the TCP transport mode

client-policy1

Name of the configuration for reporting logs to hosts

destname2

Name of the VPN instance used for transmission

test3

IPv4 address of the log host in UDP transfer mode

3.2.2.2

Port number of the log host in UDP transfer mode

1227

Log source host name type

esn

Function of reporting logs to hosts

on

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_08a6ff32d57a4684b7054a53b32042de"> 
 <edit-config> 
  <target> 
 <running/> 
  </target> 
  <error-option>rollback-on-error</error-option> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
   <syslog xmlns="urn:ietf:params:xml:ns:yang:ietf-syslog" xc:operation="remove"> 
    <log-actions> 
     <remote> 
      <destination xc:operation="remove"> 
       <name>destname1</name> 
       <vpn-instance xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog">test1</vpn-instance> 
       <tcp> 
        <address>3.2.2.101</address> 
        <port>2221</port> 
        <ssl-policy xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog">client-policy1</ssl-policy> 
       </tcp> 
       <log-selector> 
        <no-facilities/> 
       </log-selector> 
      </destination> 
      <destination xc:operation="remove"> 
       <name>destname2</name> 
       <vpn-instance xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog">test3</vpn-instance> 
       <udp> 
        <address>3.2.2.2</address> 
        <port>1227</port> 
       </udp> 
       <log-selector> 
        <no-facilities/> 
       </log-selector> 
      </destination> 
      <hostname xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog" xc:operation="remove">esn</hostname>  
      <sendswitch xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog" xc:operation="remove">on</sendswitch> 
     </remote> 
    </log-actions> 
   </syslog> 
  </config>  
 </edit-config>  
</rpc>
Response Example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_08a6ff32d57a4684b7054a53b32042de">  
 <ok/>  
</rpc-reply>

Configuring the Timestamp for Log Information

This section provides a sample of configuring the timestamp for log information.

NOTE:

V300R003C10 and later versions support this object.

Operation

XPATH

edit-config:merge

ietf-syslog/syslog/log-actions/timestamp/logformat

ietf-syslog/syslog/log-actions/timestamp/logtype

Data Requirements
Table 3-2219 Configuring the timestamp for log information

Item

Data

Description

Timestamp format of output log information

log-format-date

Configure the timestamp as the current system date and time, in the format mm dd yyyy hh:mm:ss.

Type of output logs

log-type-log

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_db0294400cc14e17b4e8c2a051854576">
 <edit-config>
  <target>
   <running/>
  </target>
  <error-option>rollback-on-error</error-option>
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
   <syslog xmlns="urn:ietf:params:xml:ns:yang:ietf-syslog">
    <log-actions>
     <timestamp xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog" xc:operation="merge">
      <logformat>log-format-date</logformat>
      <logtype>log-type-log</logtype>
     </timestamp>
    </log-actions>
   </syslog>
  </config>
 </edit-config>
</rpc>
Response Example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_db0294400cc14e17b4e8c2a051854576">  
 <ok/>  
</rpc-reply>

Restoring the Default Timestamp Format of Log Information

This section provides a sample of restoring the default timestamp format of output logs.

NOTE:

V300R003C10 and later versions support this object.

Operation

XPATH

edit-config:remove

ietf-syslog/syslog/log-actions/timestamp/logformat

ietf-syslog/syslog/log-actions/timestamp/logtype

Data Requirements
Table 3-2220 Restoring the default timestamp format of output logs

Item

Data

Description

Timestamp format of output log information

log-format-date

Cancel the log format configuration and restore the default timestamp format of output log information.

Type of output logs

log-type-log

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_db0294400cc14e17b4e8c2a051854576">
 <edit-config>
  <target>
   <running/>
  </target>
  <error-option>rollback-on-error</error-option>
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
   <syslog xmlns="urn:ietf:params:xml:ns:yang:ietf-syslog">
    <log-actions>
     <timestamp xmlns="urn:huawei:params:xml:ns:yang:huawei-syslog" xc:operation="remove">
      <logformat>log-format-date</logformat>
      <logtype>log-type-log</logtype>
     </timestamp>
    </log-actions>
   </syslog>
  </config>
 </edit-config>
</rpc>
Response Example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_db0294400cc14e17b4e8c2a051854576">  
 <ok/>  
</rpc-reply>
Translation
Download
Updated: 2019-03-06

Document ID: EDOC1100022096

Views: 8304

Downloads: 69

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next