跳转到内容
Ask AI

Syslog

此内容尚不支持你的语言。

Table 1 Syslog View

CommandPurpose
**show syslog ** [follow|tail number|grep string]Show syslog.

[Command] **show syslog ** [follow|tail number|grep string]

[Purpose] show syslog content

[Parameters]

ParameterDescription
numberSpecify the number of rows at the end of the syslog to view.
stringFilter syslog based on string content.

[View] Privileged User View

[Use Cases]

sonic# show syslog follow
Apr 22 07:00:33.664168 sonic NOTICE swss#orchagent: :- updatePortOperStatus: Port Ethernet76 oper state set from down to up
Apr 22 07:00:33.666717 sonic NOTICE swss#orchagent: :- setHostIntfsOperStatus: Set operation status UP to host interface Ethernet76
Apr 22 07:00:33.667517 sonic NOTICE swss#orchagent: :- doTask: Ethernet76 oper speed is 100000
Apr 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 36
Apr 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 syslog
Apr 22 07:06:30.884589 sonic INFO klish: show syslog
sonic# show syslog tail 5
Apr 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 syslog
Apr 22 07:06:30.884589 sonic INFO klish: show syslog
Apr 22 07:07:39.626660 sonic INFO klish: show syslog follow
sonic# show syslog grep klish
2025-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 start
Apr 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=1
Apr 18 07:38:25.945585 sonic INFO systemd[1]: Finished klish frr service.
Apr 18 08:13:33.028821 sonic INFO klish: system bash
Apr 18 09:51:22.581430 sonic INFO klish: startup

Table 2 Syslog Config

CommandPurpose
syslog server-ip [port]Set a syslog backup server.
syslog source-interface {mgmt|ethernet|loopback} interface_nameSpecify the source interface.

[Command] syslog server-ip [port]

[Purpose] Set a syslog backup server.

[Parameters]

ParameterDescription
server-ipSpecify the IP address of syslog server.
portSpecify 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 terminal
sonic(config)# syslog 10.250.0.223

syslog 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]

ParameterDescription
interface_nameInterface 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 terminal
sonic(config)# syslog source-interface ethernet 0/10