trim on output

Today I learned a handy option in show command which is particularly useful when debugging trace files.  For example if you display a debug file

host>show log debug.log
Apr  8 21:36:29 21:36:28.1118827:CID-0:RT:packet [60] ipid = 60723, @4094a01c Apr  8 21:36:29 21:36:28.1118978:CID-0:RT:---- flow_process_pkt: (thd 
3): flow_ctxt type 13, common flag 0x0, mbuf 0x40949e80, rtbl_idx = 0 Apr  8 21:36:29 21:36:28.1118978:CID-0:RT: flow process pak fast ifl 85 in_ifp 
ge-0/0/8.0 Apr  8 21:36:29 21:36:28.1118978:CID-0:RT:  ge-0/0/8.0:10.200.2.11/50998->122.122.122.188/80, tcp, flag 2 syn Apr  8 21:36:29 
21:36:28.1118978:CID-0:RT: find flow: table 0x46f0ccd0, hash 9134(0xffff), sa 10.200.2.11, da 122.122.122.188, sp 50998, dp 80, proto 6, tok 6 Apr  8
 21:36:29 21:36:28.1118978:CID-0:RT:  no session found, start first path. in_tunnel - 0, from_cp_flag - 0

output will contain many columns which you won’t need in troubleshooting. In order to remove the columns from the left side simly run;

host>show log debug.log | trim 42

About: rtoodtoo

Worked for more than 10 years as a Network/Support Engineer and also interested in Python, Linux, Security and SD-WAN, currently living in the Netherlands and works as a Network Support Engineer. // JNCIE-SEC #223 / RHCE / PCNSE


You have a feedback?

This site uses Akismet to reduce spam. Learn how your comment data is processed.