Syslog
此内容尚不支持你的语言。
Table 1 Syslog View
| Command | Purpose |
|---|---|
| **show syslog ** [follow|tail number|grep string] | Show syslog. |
show syslog [follow|tail
Section titled “show syslog [follow|tail”[Command] **show syslog ** [follow|tail number|grep string]
[Purpose] show syslog content
[Parameters]
| Parameter | Description |
|---|---|
| number | Specify the number of rows at the end of the syslog to view. |
| string | Filter syslog based on string content. |
[View] Privileged User View
[Use Cases]
sonic# show syslog followApr 22 07:00:33.664168 sonic NOTICE swss#orchagent: :- updatePortOperStatus: Port Ethernet76 oper state set from down to upApr 22 07:00:33.666717 sonic NOTICE swss#orchagent: :- setHostIntfsOperStatus: Set operation status UP to host interface Ethernet76Apr 22 07:00:33.667517 sonic NOTICE swss#orchagent: :- doTask: Ethernet76 oper speed is 100000Apr 22 07:01:16.122292 sonic WARNING snmp#snmp-subagent [sonic_ax_impl] WARNING: SyncD 'COUNTERS_DB' missing attribute ''SAI_PORT_STAT_IF_IN_DISCARDS''.Apr 22 07:01:16.190548 sonic WARNING snmp#snmp-subagent [sonic_ax_impl] WARNING: SyncD 'COUNTERS_DB' missing attribute ''SAI_PORT_STAT_IF_OUT_DISCARDS''.Apr 22 07:03:05.328015 sonic INFO smartd[517]: Device: /dev/sda [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 37 to 36Apr 22 07:06:17.081883 sonic WARNING snmp#snmp-subagent [sonic_ax_impl] WARNING: SyncD 'COUNTERS_DB' missing attribute ''SAI_PORT_STAT_IF_IN_DISCARDS''.Apr 22 07:06:17.153121 sonic WARNING snmp#snmp-subagent [sonic_ax_impl] WARNING: SyncD 'COUNTERS_DB' missing attribute ''SAI_PORT_STAT_IF_OUT_DISCARDS''.Apr 22 07:06:26.931226 sonic INFO klish: show syslogApr 22 07:06:30.884589 sonic INFO klish: show syslogsonic# show syslog tail 5Apr 22 07:06:17.081883 sonic WARNING snmp#snmp-subagent [sonic_ax_impl] WARNING: SyncD 'COUNTERS_DB' missing attribute ''SAI_PORT_STAT_IF_IN_DISCARDS''.Apr 22 07:06:17.153121 sonic WARNING snmp#snmp-subagent [sonic_ax_impl] WARNING: SyncD 'COUNTERS_DB' missing attribute ''SAI_PORT_STAT_IF_OUT_DISCARDS''.Apr 22 07:06:26.931226 sonic INFO klish: show syslogApr 22 07:06:30.884589 sonic INFO klish: show syslogApr 22 07:07:39.626660 sonic INFO klish: show syslog followsonic# show syslog grep klish2025-04-18T07:35:50.259047+00:00 sonic systemd[1]: Starting klish service...2025-04-18T07:35:50.259047+00:00 sonic systemd[1]: Starting klish service...Apr 18 07:36:05.905241 sonic INFO systemd[1]: Starting klish frr service...Apr 18 07:36:07.395529 sonic INFO restore_cfg.py[1863]: Start to restore klish CLI configure.Apr 18 07:36:07.395612 sonic INFO restore_cfg.py[1863]: klish startApr 18 07:36:07.736139 sonic INFO systemd[1]: Finished klish service.Apr 18 07:38:25.885025 sonic INFO restore_frr.py[3030]: No klish configure in database. Program exit now.Apr 18 07:38:25.885149 sonic INFO restore_frr.py[3030]: set klish_restore_finished=1Apr 18 07:38:25.945585 sonic INFO systemd[1]: Finished klish frr service.Apr 18 08:13:33.028821 sonic INFO klish: system bashApr 18 09:51:22.581430 sonic INFO klish: startupSyslog Config
Section titled “Syslog Config”Table 2 Syslog Config
| Command | Purpose |
|---|---|
| syslog server-ip [port] | Set a syslog backup server. |
| syslog source-interface {mgmt|ethernet|loopback} interface_name | Specify the source interface. |
syslog
Section titled “syslog”[Command] syslog server-ip [port]
[Purpose] Set a syslog backup server.
[Parameters]
| Parameter | Description |
|---|---|
| server-ip | Specify the IP address of syslog server. |
| port | Specify the UDP destination port of the message. |
[View] Global Configuration View
[Notes] Run command no syslog server-ip to delete syslog backup server.
[Use Cases]
sonic# configure terminalsonic(config)# syslog 10.250.0.223syslog source-interface {mgmt|ethernet|loopback}
Section titled “syslog source-interface {mgmt|ethernet|loopback}”[Command] syslog source-interface {mgmt|ethernet|loopback} interface_name
[Purpose] Specify the source interface.
[Parameters]
| Parameter | Description |
|---|---|
| interface_name | Interface name (eg.0/1). When specify mgmt the interface name is 0. |
[View] Global Configuration View
[Notes] Run command no syslog source-interface to delete syslog source interface.
[Use Cases]
sonic# configure terminalsonic(config)# syslog source-interface ethernet 0/10