---
title: Syslog
slug: aidc/syslog
createdAt: 2025-12-01T11:11:09.000Z
---

## <font color="#1d50a2">Syslog View</font>

<font color="#1d05a2">Table 1 Syslog View</font>

| **Command**                                                         | **Purpose**  |
| ------------------------------------------------------------------- | ------------ |
| **show syslog** \[**follow**\|**tail** *number*\|**grep** *string*] | Show syslog. |

### <font color="#1d50a2">show syslog \[follow|tail *number*|grep *string*\]</font>

**\[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]**

```plaintext
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
```

## <font color="#1d50a2">Syslog Config</font>

<font color="#1d05a2">Table 2 Syslog Config</font>

| **Command**                                                               | **Purpose**                   |
| ------------------------------------------------------------------------- | ----------------------------- |
| **syslog** *server-ip* \[*port*]                                          | Set a syslog backup server.   |
| **syslog source-interface \{mgmt\|ethernet\|loopback}** *interface\_name* | Specify the source interface. |

### <font color="#1d50a2">syslog *server-ip* \[*port*\]</font>

**\[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]**

```plaintext
sonic# configure terminal
sonic(config)# syslog 10.250.0.223
```

### <font color="#1d50a2">syslog source-interface \{mgmt|ethernet|loopback\} *interface\_name*</font>

**\[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]**

```plaintext
sonic# configure terminal
sonic(config)# syslog source-interface ethernet 0/10
```

