在此页面上
show log
语法
show log <filename | user <username>>
语法(QFX 系列和 OCX 系列)
show log filename <device-type (device-id | device-alias)>
语法(TX 矩阵路由器)
show log <all-lcc | lcc number | scc> <filename | user <username>>
描述
列出日志文件,显示日志文件内容,或显示有关已登录到路由器或交换机的用户的信息。
在 MX 系列路由器上,修改配置以将服务接口替换为另一个服务接口被视为灾难性事件。修改配置时,将与服务接口关联的整个配置(包括 NAT 池、规则和服务集)将被删除,然后为新指定的服务接口重新创建。如果存在与要替换的服务接口关联的活动会话,则会删除这些会话,然后释放 NAT 池,从而导致生成NAT_POOL_RELEASE系统日志消息。但是,由于灾难性配置更改导致 NAT 池已被删除,不再存在,因此不会为更改后的配置生成NAT_POOL_RELEASE系统日志消息。
选项
none | 列出所有日志文件。 |
<all-lcc | lcc number | scc> | (仅限路由矩阵)(可选)显示有关连接到 TX Matrix 路由器的所有 T640 路由器(或线卡机箱)或特定 T640 路由器(替换为 |
device-type | (仅限 QFabric 系统)(可选)仅显示以下设备类型之一的日志消息:
注意:
如果指定可选参数,则还必须指定 |
(device-id | device-alias) | 如果指定了设备类型,则显示该类型设备的日志。指定设备 ID 或设备别名(如果已配置)。 |
filename | (可选)显示指定日志文件中的日志消息。对于路由矩阵,文件名必须包含机箱信息。
注意:
该 filename 参数对于 QFabric 系统是必需的。如果未配置 syslog 文件名,请指定 消息的默认文件名。 |
user <username> | (可选)显示有关最近登录到路由器或交换机的用户的日志记录信息。如果包括 |
所需权限级别
跟踪
示例输出
显示日志
user@host> show log total 57518 -rw-r--r-- 1 root bin 211663 Oct 1 19:44 dcd -rw-r--r-- 1 root bin 999947 Oct 1 19:41 dcd.0 -rw-r--r-- 1 root bin 999994 Oct 1 17:48 dcd.1 -rw-r--r-- 1 root bin 238815 Oct 1 19:44 rpd -rw-r--r-- 1 root bin 1049098 Oct 1 18:00 rpd.0 -rw-r--r-- 1 root bin 1061095 Oct 1 12:13 rpd.1 -rw-r--r-- 1 root bin 1052026 Oct 1 06:08 rpd.2 -rw-r--r-- 1 root bin 1056309 Sep 30 18:21 rpd.3 -rw-r--r-- 1 root bin 1056371 Sep 30 14:36 rpd.4 -rw-r--r-- 1 root bin 1056301 Sep 30 10:50 rpd.5 -rw-r--r-- 1 root bin 1056350 Sep 30 07:04 rpd.6 -rw-r--r-- 1 root bin 1048876 Sep 30 03:21 rpd.7 -rw-rw-r-- 1 root bin 19656 Oct 1 19:37 wtmp
显示日志文件名
user@host> show log rpd Oct 1 18:00:18 trace_on: Tracing to ?/var/log/rpd? started Oct 1 18:00:18 EVENT <MTU> ds-5/2/0.0 index 24 <Broadcast PointToPoint Multicast Oct 1 18:00:18 Oct 1 18:00:19 KRT recv len 56 V9 seq 148 op add Type route/if af 2 addr 192.0.2.21 nhop type local nhop 192.0.2.21 Oct 1 18:00:19 KRT recv len 56 V9 seq 149 op add Type route/if af 2 addr 192.0.2.22 nhop type unicast nhop 192.0.2.22 Oct 1 18:00:19 KRT recv len 48 V9 seq 150 op add Type ifaddr index 24 devindex 43 Oct 1 18:00:19 KRT recv len 144 V9 seq 151 op chnge Type ifdev devindex 44 Oct 1 18:00:19 KRT recv len 144 V9 seq 152 op chnge Type ifdev devindex 45 Oct 1 18:00:19 KRT recv len 144 V9 seq 153 op chnge Type ifdev devindex 46 Oct 1 18:00:19 KRT recv len 1272 V9 seq 154 op chnge Type ifdev devindex 47 ... user@host:LSYS1> show log flow_lsys1.log Nov 7 07:34:09 07:34:09.491800:CID-0:THREAD_ID-00:LSYS_ID-01:RT:got route table lock Nov 7 07:34:09 07:34:09.491809:CID-0:THREAD_ID-00:LSYS_ID-01:RT:released route table lock Nov 7 07:34:09 07:34:09.491840:CID-0:THREAD_ID-00:LSYS_ID-01:RT:got route table lock Nov 7 07:34:09 07:34:09.491841:CID-0:THREAD_ID-00:LSYS_ID-01:RT:released route table lock Nov 7 07:34:09 07:34:09.491854:CID-0:THREAD_ID-00:LSYS_ID-01:RT:cache final sw_nh 0x0 Nov 7 07:34:09 07:34:09.491868:CID-0:THREAD_ID-00:LSYS_ID-01:RT:got route table lock Nov 7 07:34:09 07:34:09.491869:CID-0:THREAD_ID-00:LSYS_ID-01:RT:released route table lock Nov 7 07:34:09 07:34:09.491881:CID-0:THREAD_ID-00:LSYS_ID-01:RT:cache final sw_nh 0x0 user@host:TSYS1> show log flow_tsys1.log Nov 7 13:21:47 13:21:47.217744:CID-0:THREAD_ID-05:LSYS_ID-32:RT:<192.0.2.0/0->198.51.100.0/9011;1,0x0> : Nov 7 13:21:47 13:21:47.217747:CID-0:THREAD_ID-05:LSYS_ID-32:RT:packet [84] ipid = 39281, @0x7f490ae56d52 Nov 7 13:21:47 13:21:47.217749:CID-0:THREAD_ID-05:LSYS_ID-32:RT:---- flow_process_pkt: (thd 5): flow_ctxt type 0, common flag 0x0, mbuf 0x4882b600, rtbl7 Nov 7 13:21:47 13:21:47.217752:CID-0:THREAD_ID-05:LSYS_ID-32:RT: flow process pak fast ifl 88 in_ifp lt-0/0/0.101 Nov 7 13:21:47 13:21:47.217753:CID-0:THREAD_ID-05:LSYS_ID-32:RT: lt-0/0/0.101:192.0.2.0->198.51.100.0, icmp, (0/0) Nov 7 13:21:47 13:21:47.217756:CID-0:THREAD_ID-05:LSYS_ID-32:RT: find flow: table 0x11d0a2680, hash 20069(0xffff), sa 192.0.2.0, da 198.51.100.0, sp 0, d0 Nov 7 13:21:47 13:21:47.217760:CID-0:THREAD_ID-05:LSYS_ID-32:RT:Found: session id 0x12. sess tok 28685 Nov 7 13:21:47 13:21:47.217761:CID-0:THREAD_ID-05:LSYS_ID-32:RT: flow got session. Nov 7 13:21:47 13:21:47.217761:CID-0:THREAD_ID-05:LSYS_ID-32:RT: flow session id 18 Nov 7 13:21:47 13:21:47.217763:CID-0:THREAD_ID-05:LSYS_ID-32:RT: vector bits 0x200 vector 0x84ae85f0 Nov 7 13:21:47 13:21:47.217764:CID-0:THREAD_ID-05:LSYS_ID-32:RT:set nat 0x11e463550(18) timeout const to 2 Nov 7 13:21:47 13:21:47.217765:CID-0:THREAD_ID-05:LSYS_ID-32:RT: set_nat_timeout 2 on session 18 Nov 7 13:21:47 13:21:47.217765:CID-0:THREAD_ID-05:LSYS_ID-32:RT:refresh nat 0x11e463550(18) timeout to 2 Nov 7 13:21:47 13:21:47.217767:CID-0:THREAD_ID-05:LSYS_ID-32:RT:insert usp tag for apps Nov 7 13:21:47 13:21:47.217768:CID-0:THREAD_ID-05:LSYS_ID-32:RT:mbuf 0x4882b600, exit nh 0xfffb0006
show log filename(QFabric 系统)
user@qfabric> show log messages Mar 28 18:00:06 qfabric chassisd: QFABRIC_INTERNAL_SYSLOG: Mar 28 18:00:06 ED1486 chassisd: CHASSISD_SNMP_TRAP10: SNMP trap generated: FRU power on (jnxFruContentsIndex 8, jnxFruL1Index 1, jnxFruL2Index 1, jnxFruL3Index 0, jnxFruName PIC: 48x 10G-SFP+ @ 0/0/*, jnxFruType 11, jnxFruSlot 0, jnxFruOfflineReason 2, jnxFruLastPowerOff 0, jnxFruLastPowerOn 2159) Mar 28 18:00:07 qfabric chassisd: QFABRIC_INTERNAL_SYSLOG: Mar 28 18:00:07 ED1486 chassisd: CHASSISD_SNMP_TRAP10: SNMP trap generated: FRU power on (jnxFruContentsIndex 8, jnxFruL1Index 1, jnxFruL2Index 2, jnxFruL3Index 0, jnxFruName PIC: @ 0/1/*, jnxFruType 11, jnxFruSlot 0, jnxFruOfflineReason 2, jnxFruLastPowerOff 0, jnxFruLastPowerOn 2191) Mar 28 18:00:07 qfabric chassisd: QFABRIC_INTERNAL_SYSLOG: Mar 28 18:00:07 ED1492 chassisd: CHASSISD_SNMP_TRAP10: SNMP trap generated: FRU power on (jnxFruContentsIndex 8, jnxFruL1Index 1, jnxFruL2Index 1, jnxFruL3Index 0, jnxFruName PIC: 48x 10G-SFP+ @ 0/0/*, jnxFruType 11, jnxFruSlot 0, jnxFruOfflineReason 2, jnxFruLastPowerOff 0, jnxFruLastPowerOn 242726) Mar 28 18:00:07 qfabric chassisd: QFABRIC_INTERNAL_SYSLOG: Mar 28 18:00:07 ED1492 chassisd: CHASSISD_SNMP_TRAP10: SNMP trap generated: FRU power on (jnxFruContentsIndex 8, jnxFruL1Index 1, jnxFruL2Index 2, jnxFruL3Index 0, jnxFruName PIC: @ 0/1/*, jnxFruType 11, jnxFruSlot 0, jnxFruOfflineReason 2, jnxFruLastPowerOff 0, jnxFruLastPowerOn 242757) Mar 28 18:00:16 qfabric file: QFABRIC_INTERNAL_SYSLOG: Mar 28 18:00:16 ED1486 file: UI_COMMIT: User 'root' requested 'commit' operation (comment: none) Mar 28 18:00:27 qfabric file: QFABRIC_INTERNAL_SYSLOG: Mar 28 18:00:27 ED1486 file: UI_COMMIT: User 'root' requested 'commit' operation (comment: none) Mar 28 18:00:50 qfabric file: QFABRIC_INTERNAL_SYSLOG: Mar 28 18:00:50 _DCF_default___NW-INE-0_RE0_ file: UI_COMMIT: User 'root' requested 'commit' operation (comment: none) Mar 28 18:00:50 qfabric file: QFABRIC_INTERNAL_SYSLOG: Mar 28 18:00:50 _DCF_default___NW-INE-0_RE0_ file: UI_COMMIT: User 'root' requested 'commit' operation (comment: none) Mar 28 18:00:55 qfabric file: QFABRIC_INTERNAL_SYSLOG: Mar 28 18:00:55 ED1492 file: UI_COMMIT: User 'root' requested 'commit' operation (comment: none) Mar 28 18:01:10 qfabric file: QFABRIC_INTERNAL_SYSLOG: Mar 28 18:01:10 ED1492 file: UI_COMMIT: User 'root' requested 'commit' operation (comment: none) Mar 28 18:02:37 qfabric chassisd: QFABRIC_INTERNAL_SYSLOG: Mar 28 18:02:37 ED1491 chassisd: CHASSISD_SNMP_TRAP10: SNMP trap generated: FRU power on (jnxFruContentsIndex 8, jnxFruL1Index 1, jnxFruL2Index 1, jnxFruL3Index 0, jnxFruName PIC: 48x 10G-SFP+ @ 0/0/*, jnxFruType 11, jnxFruSlot 0, jnxFruOfflineReason 2, jnxFruLastPowerOff 0, jnxFruLastPowerOn 33809)
显示日志用户
user@host> show log user usera mg2546 Thu Oct 1 19:37 still logged in usera mg2529 Thu Oct 1 19:08 - 19:36 (00:28) usera mg2518 Thu Oct 1 18:53 - 18:58 (00:04) root mg1575 Wed Sep 30 18:39 - 18:41 (00:02) root ttyp2 aaa.bbbb.com Wed Sep 30 18:39 - 18:41 (00:02) userb ttyp1 192.0.2.0 Wed Sep 30 01:03 - 01:22 (00:19)
显示日志接受的流量(SRX4600、SRX5400、SRX5600 和 SRX5800)
user@host> show log accepted-traffic Jul 17 20:26:04 sourpunch RT_FLOW: RT_FLOW_SESSION_CREATE: session created 3.3.3.5/2->4.4.4.2/63 0x0 None 3.3.3.5/2->4.4.4.2/63 0x0 N/A N/A N/A N/A 17 p2 TRUST UNTRUST 2617282058 N/A(N/A) xe-7/0/0.0 UNKNOWN UNKNOWN UNKNOWN N/A N/A -1 N/A N/A N/A Jul 17 20:26:04 sourpunch RT_FLOW: RT_FLOW_SESSION_CREATE: session created 3.3.3.4/4->4.4.4.2/63 0x0 None 3.3.3.4/4->4.4.4.2/63 0x0 N/A N/A N/A N/A 17 p2 TRUST UNTRUST 2550162754 N/A(N/A) xe-7/0/0.0 UNKNOWN UNKNOWN UNKNOWN N/A N/A -1 N/A N/A N/A Jul 17 20:26:04 sourpunch RT_FLOW: RT_FLOW_SESSION_CREATE: session created 3.3.3.4/1->4.4.4.2/63 0x0 None 3.3.3.4/1->4.4.4.2/63 0x0 N/A N/A N/A N/A 17 p2 TRUST UNTRUST 2550162755 N/A(N/A) xe-7/0/0.0 UNKNOWN UNKNOWN UNKNOWN N/A N/A -1 N/A N/A N/A Jul 17 20:26:04 sourpunch RT_FLOW: RT_FLOW_SESSION_CREATE: session created 3.3.3.3/0->4.4.4.2/63 0x0 None 3.3.3.3/0->4.4.4.2/63 0x0 N/A N/A N/A N/A 17 p2 TRUST UNTRUST 2550162752 N/A(N/A) xe-7/0/0.0 UNKNOWN UNKNOWN UNKNOWN N/A N/A -1 N/A N/A N/A Jul 17 20:26:04 sourpunch RT_FLOW: RT_FLOW_SESSION_CREATE: session created 3.3.3.5/5->4.4.4.2/63 0x0 None 3.3.3.5/5->4.4.4.2/63 0x0 N/A N/A N/A N/A 17 p2 TRUST UNTRUST 2550162751 N/A(N/A) xe-7/0/0.0 UNKNOWN UNKNOWN UNKNOWN N/A N/A -1 N/A N/A N/A Jul 17 20:26:04 sourpunch RT_FLOW: RT_FLOW_SESSION_CREATE: session created 3.3.3.3/3->4.4.4.2/63 0x0 None 3.3.3.3/3->4.4.4.2/63 0x0 N/A N/A N/A N/A 17 p2 TRUST UNTRUST 2550162753 N/A(N/A) xe-7/0/0.0 UNKNOWN UNKNOWN UNKNOWN N/A N/A -1 N/A N/A N/A
发布信息
在 Junos OS 7.4 版之前引入的命令。
Option device-type (device-id | device-alias) 在适用于 QFX 系列的 Junos OS 13.1 版中引入。