SRX

Expand all | Collapse all

Trace option Log file how to delete it?

Jump to Best Answer
  • 1.  Trace option Log file how to delete it?

    Posted 08-16-2017 07:19

    Hi everybody,

     

    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 [48] ipid = 57203, @423f6b9e

    ---- flow_process_pkt: (thd 1): flow_ctxt type 13, common flag 0x0,

    mbuf 0x423f6a00

    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_create_session

    flow_first_in_dst_nat: in <ge-0/0/0.0>, out

       SNIP!!!!

     

    What is “trim 42” above?

     

    Thanks and have a good day!!



  • 2.  RE: Trace option Log file how to delete it?
    Best Answer

     
    Posted 08-16-2017 07:38

    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.



  • 3.  RE: Trace option Log file how to delete it?

    Posted 08-16-2017 07:50

    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"

     

    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.



  • 4.  RE: Trace option Log file how to delete it?

    Posted 08-16-2017 09:35

    Hi,

     

    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.

     

     

    Regards,

    Rahul

    Please mark my solution as accepted if it helped.