Let say we performed trace option on SRX and all our logs are now in file “ tshoot web”
set file tshoot_web
This file is in default folder VAR
My question is once we are done with analyzing data, how do we delete this file” tshoot web” so it will not consume memory.
My second question is about the output shown below:
juniper@SRX5800> show log tshoot_web | trim 42
<10.1.1.100/51510->10.2.0.3/80;6> matched filter trust_to_web:
packet  ipid = 57203, @423f6b9e
---- flow_process_pkt: (thd 1): flow_ctxt type 13, common flag 0x0,
flow process pak fast ifl 68 in_ifp ge-0/0/0.0
ge-0/0/0.0:10.1.1.100/51510->10.2.0.3/80, tcp, flag 2 syn
find flow: table 0x4d5c8238, hash 1430(0xffff), sa 10.1.1.100, da
10.2.0.3, sp 51510, dp 80, proto 6, tok 384
no session found, start first path. in_tunnel - 0, from_cp_flag - 0
flow_first_in_dst_nat: in <ge-0/0/0.0>, out
What is “trim 42” above?
Thanks and have a good day!!
To delete log file issue a command:
clear log <log file name>
Trim will hide n first characters of every displayed line.
In your example | trim 27 would hide all the timestamps.
Thanks , my apology, i just see that at the end of the link I pasted before:
"To remove old troubleshooting logfiles, use the file delete <filename> command. It’s always a best practice to remove old, unused files when you no longer need them"
file delete <filename>
Is there a difference between this and your command? It looks like your command will just clear the logs from the file but file will still be there unless get deleted. I may be wrong. Just my hunch.
file delete <filename> will delete the file completely however "clear log" will delete all the content of the file. Clear log is useful if you want to keep the file configured and delete the contents.
Please mark my solution as accepted if it helped.